Fix issue where piston won't push particles at index 0
This commit is contained in:
parent
631e49b8b7
commit
03fde95719
@ -176,7 +176,7 @@ int Element_PSTN::MoveStack(Simulation * sim, int stackX, int stackY, int direct
|
|||||||
} else
|
} else
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for(int c = 1; c < MAX_FRAME; c++) {
|
for(int c = 1; c < MAX_FRAME; c++) {
|
||||||
posY = stackY - (c*newY);
|
posY = stackY - (c*newY);
|
||||||
posX = stackX - (c*newX);
|
posX = stackX - (c*newX);
|
||||||
@ -228,7 +228,7 @@ int Element_PSTN::MoveStack(Simulation * sim, int stackX, int stackY, int direct
|
|||||||
r = sim->pmap[posY][posX];
|
r = sim->pmap[posY][posX];
|
||||||
if(!r) {
|
if(!r) {
|
||||||
spaces++;
|
spaces++;
|
||||||
tempParts[currentPos++] = 0;
|
tempParts[currentPos++] = -1;
|
||||||
if(spaces >= amount)
|
if(spaces >= amount)
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
@ -244,7 +244,7 @@ int Element_PSTN::MoveStack(Simulation * sim, int stackX, int stackY, int direct
|
|||||||
int possibleMovement = 0;
|
int possibleMovement = 0;
|
||||||
for(int j = currentPos-1; j >= 0; j--) {
|
for(int j = currentPos-1; j >= 0; j--) {
|
||||||
int jP = tempParts[j];
|
int jP = tempParts[j];
|
||||||
if(!jP) {
|
if(jP == -1) {
|
||||||
possibleMovement++;
|
possibleMovement++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user