Skip to content

Commit 0c4d633

Browse files
author
seb-135
committed
Fixed fakeplayers sometimes failing to pick up coins
1 parent f7daae1 commit 0c4d633

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

src/Me.as

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,25 @@ package {
7474
if (!Global.base.settings.particles) break;
7575
for (var k:int = 0; k < 4; k++)
7676
spawnCoinPatricle(cx, cy, current == ItemId.COIN_BLUE);
77-
} else {
78-
if ((current == ItemId.COIN_GOLD || current == 110) && (gx.indexOf(cx) == -1 || gy.indexOf(cy) == -1)) {
79-
coins++;
80-
gx.push(cx)
81-
gy.push(cy);
77+
} else if (!isme){
78+
var found:Boolean = false;
79+
for (var i:int = 0; i < gx.length; i++) {
80+
if (gx[i] == cx && gy[i] == cy) {
81+
found = true;
82+
break;
83+
}
8284
}
83-
else if ((current == ItemId.COIN_BLUE || current == 111) && (bx.indexOf(cx) == -1 || by.indexOf(cy) == -1)) {
84-
bcoins++;
85-
bx.push(cx);
86-
by.push(cy);
85+
if (!found) {
86+
if (current == ItemId.COIN_GOLD || current == 110) {
87+
coins++;
88+
gx.push(cx)
89+
gy.push(cy);
90+
}
91+
else if (current == ItemId.COIN_BLUE || current == 111) {
92+
bcoins++;
93+
bx.push(cx);
94+
by.push(cy);
95+
}
8796
}
8897
}
8998
break;

0 commit comments

Comments
 (0)