summaryrefslogtreecommitdiff
path: root/src/simulation/elements/PSTN.cpp
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2013-01-26 18:56:19 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2013-01-26 18:56:19 (GMT)
commit03fde95719df5c917de84a8a791bd3f42e3c7859 (patch)
tree681e369eefb1c14c986389ed408cfcd96c2ed9a0 /src/simulation/elements/PSTN.cpp
parent631e49b8b72d9875e50e3b39caa9612ffddec3a6 (diff)
downloadpowder-03fde95719df5c917de84a8a791bd3f42e3c7859.zip
powder-03fde95719df5c917de84a8a791bd3f42e3c7859.tar.gz
Fix issue where piston won't push particles at index 0
Diffstat (limited to 'src/simulation/elements/PSTN.cpp')
-rw-r--r--src/simulation/elements/PSTN.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/simulation/elements/PSTN.cpp b/src/simulation/elements/PSTN.cpp
index 3714f8e..d25f249 100644
--- a/src/simulation/elements/PSTN.cpp
+++ b/src/simulation/elements/PSTN.cpp
@@ -176,7 +176,7 @@ int Element_PSTN::MoveStack(Simulation * sim, int stackX, int stackY, int direct
} else
break;
}
- }
+ }
for(int c = 1; c < MAX_FRAME; c++) {
posY = stackY - (c*newY);
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];
if(!r) {
spaces++;
- tempParts[currentPos++] = 0;
+ tempParts[currentPos++] = -1;
if(spaces >= amount)
break;
} else {
@@ -244,7 +244,7 @@ int Element_PSTN::MoveStack(Simulation * sim, int stackX, int stackY, int direct
int possibleMovement = 0;
for(int j = currentPos-1; j >= 0; j--) {
int jP = tempParts[j];
- if(!jP) {
+ if(jP == -1) {
possibleMovement++;
continue;
}