summaryrefslogtreecommitdiff
path: root/src/simulation
diff options
context:
space:
mode:
authorjacob1 <jfu614@gmail.com>2013-10-18 20:13:04 (GMT)
committer jacob1 <jfu614@gmail.com>2013-10-18 20:13:40 (GMT)
commitba43e4d238ab60255bde40afd3eb1430fb18ea08 (patch)
tree95f721c12f11f5b3faf72ee32a5a4a0a8e2f482b /src/simulation
parent02a4c17d72def847205c8c89dacabe9ecdcb0dab (diff)
downloadpowder-ba43e4d238ab60255bde40afd3eb1430fb18ea08.zip
powder-ba43e4d238ab60255bde40afd3eb1430fb18ea08.tar.gz
revert b17ef7f93880 (couldn't figure out better fix for the new PSTN bug), fix annoyance with clicking on save comments changing pages
Diffstat (limited to 'src/simulation')
-rw-r--r--src/simulation/elements/PSTN.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/simulation/elements/PSTN.cpp b/src/simulation/elements/PSTN.cpp
index 998f7a2..6dda77f 100644
--- a/src/simulation/elements/PSTN.cpp
+++ b/src/simulation/elements/PSTN.cpp
@@ -167,7 +167,7 @@ int Element_PSTN::update(UPDATE_FUNC_ARGS)
//#TPT-Directive ElementHeader Element_PSTN static int CanMoveStack(Simulation * sim, int stackX, int stackY, int directionX, int directionY, int maxSize, int amount, bool retract, int block)
int Element_PSTN::CanMoveStack(Simulation * sim, int stackX, int stackY, int directionX, int directionY, int maxSize, int amount, bool retract, int block)
{
- int posX, posY, r, spaces = 0, currentPos = 0, num = 0;
+ int posX, posY, r, spaces = 0, currentPos = 0;
if (amount <= 0)
return 0;
for(posX = stackX, posY = stackY; currentPos < maxSize + amount && currentPos < XRES-1; posX += directionX, posY += directionY) {
@@ -176,7 +176,7 @@ int Element_PSTN::CanMoveStack(Simulation * sim, int stackX, int stackY, int dir
}
r = sim->pmap[posY][posX];
if (sim->IsWallBlocking(posX, posY, 0) || (block && (r&0xFF) == block))
- return num;
+ return spaces;
if(!r) {
spaces++;
tempParts[currentPos++] = -1;
@@ -186,9 +186,8 @@ int Element_PSTN::CanMoveStack(Simulation * sim, int stackX, int stackY, int dir
if(spaces < maxSize && currentPos < maxSize && (!retract || ((r&0xFF) == PT_FRME) && posX == stackX && posY == stackY))
tempParts[currentPos++] = r>>8;
else
- return num;
+ return spaces;
}
- num++;
}
if (spaces)
return currentPos;