Skip to content

Commit

Permalink
Small fixes (again)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmalahie committed Aug 14, 2024
1 parent 22e0eea commit 0674bea
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions scripts/mk.js
Original file line number Diff line number Diff line change
Expand Up @@ -2509,7 +2509,7 @@ function arme(ID, backwards, forwards) {
}
}
}
var item = {type: "carapace-bleue", team:oKart.team, x:oKart.x,y:oKart.y,z:15, target:-1, aipoint:minAiPt, aimap:minAiMap, ailap:lapId, ailapt:oKart.tours, cooldown:itemBehaviors["carapace-bleue"].cooldown0};
var item = {type: "carapace-bleue", team:oKart.team, x:oKart.x,y:oKart.y,z:15, target:-1, aipoint:minAiPt, aimap:minAiMap, ailap:lapId, ailapt:oKart.tours, ailapc:1, cooldown:itemBehaviors["carapace-bleue"].cooldown0};
addNewItem(oKart, item);
playDistSound(oKart,"musics/events/throw.mp3",50);
break;
Expand Down Expand Up @@ -2666,7 +2666,7 @@ function arme(ID, backwards, forwards) {
if (backwards)
itemPayload = {x:posX+shiftDist*direction(0,oAngleView),y:posY+shiftDist*direction(1,oAngleView),z:0,theta:oAngleView,owner:oKart.id,aipoint:-2,aimap:-1,ailap:lapId,ailapt:oKart.tours,target:-1};
else
itemPayload = {x:posX+shiftDist*direction(0, oAngleView), y:posY+shiftDist*direction(1,oAngleView),z:0,theta:oAngleView,owner:oKart.id,aipoint:-1,aimap:-1,ailap:lapId,ailapt:oKart.tours,target:-1};
itemPayload = {x:posX+shiftDist*direction(0, oAngleView), y:posY+shiftDist*direction(1,oAngleView),z:0,theta:oAngleView,owner:oKart.id,aipoint:-1,aimap:-1,ailap:lapId,ailapt:oKart.tours,ailapc:1,target:-1};
checkItemLap(itemPayload, { aPos: [posX,posY], fast: true });
throwItem(oKart, itemPayload);
playDistSound(oKart,"musics/events/throw.mp3",50);
Expand Down Expand Up @@ -7910,7 +7910,7 @@ var itemBehaviors = {
}
}
}
checkItemLap(fSprite, { aPos: aPos });
checkItemLap(fSprite, { aPos: aPos, fast: true });
if (cible == -1) {
cible = aKarts.length-1;
for (var cPlace=1;cPlace<=aKarts.length;cPlace++) {
Expand Down Expand Up @@ -10323,13 +10323,12 @@ function checkItemLap(fSprite, opts) {
}
function incItemLap(lMap, fSprite) {
fSprite.ailap++;
var nMap = getCurrentLMap(fSprite.ailap);
if (nMap.aipoints === lMap.aipoints) return;
fSprite.ailapc = 0;
if (fSprite.aipoint >= 0 && fSprite.aimap >= 0) {
var nMap = getCurrentLMap(fSprite.ailap);
if (nMap.aipoints !== lMap.aipoints) {
fSprite.aimap %= nMap.aipoints.length;
fSprite.aipoint = 0;
fSprite.ailapc = 0;
}
fSprite.aimap %= nMap.aipoints.length;
fSprite.aipoint = 0;
}
}
function render() {
Expand Down

0 comments on commit 0674bea

Please sign in to comment.