Skip to content

Commit

Permalink
Fixed fakeplayers sometimes failing to pick up coins
Browse files Browse the repository at this point in the history
  • Loading branch information
seb-135 committed Jan 20, 2021
1 parent f7daae1 commit 0c4d633
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions src/Me.as
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,25 @@ package {
if (!Global.base.settings.particles) break;
for (var k:int = 0; k < 4; k++)
spawnCoinPatricle(cx, cy, current == ItemId.COIN_BLUE);
} else {
if ((current == ItemId.COIN_GOLD || current == 110) && (gx.indexOf(cx) == -1 || gy.indexOf(cy) == -1)) {
coins++;
gx.push(cx)
gy.push(cy);
} else if (!isme){
var found:Boolean = false;
for (var i:int = 0; i < gx.length; i++) {
if (gx[i] == cx && gy[i] == cy) {
found = true;
break;
}
}
else if ((current == ItemId.COIN_BLUE || current == 111) && (bx.indexOf(cx) == -1 || by.indexOf(cy) == -1)) {
bcoins++;
bx.push(cx);
by.push(cy);
if (!found) {
if (current == ItemId.COIN_GOLD || current == 110) {
coins++;
gx.push(cx)
gy.push(cy);
}
else if (current == ItemId.COIN_BLUE || current == 111) {
bcoins++;
bx.push(cx);
by.push(cy);
}
}
}
break;
Expand Down

0 comments on commit 0c4d633

Please sign in to comment.