Permalink
Browse files

fix issue where stamps would stack if you loaded multiple in one frame

sim.loadStamp in the console, or a lua script
  • Loading branch information...
jacob1 committed Dec 4, 2017
1 parent 63c13bd commit e956e7c5fdb26e8f6715f95ca99adebfa6d1a547
Showing with 5 additions and 4 deletions.
  1. +5 −4 src/simulation/Simulation.cpp
@@ -123,15 +123,15 @@ int Simulation::Load(int fullX, int fullY, GameSave * save, bool includePressure
elementCount[parts[r>>8].type]--;
parts[r>>8] = tempPart;
i = r>>8;
pmap[y][x] = 0;
pmap[y][x] = tempPart.type | i<<8;
elementCount[tempPart.type]++;
}
else if ((r = photons[y][x]))
{
elementCount[parts[r>>8].type]--;
parts[r>>8] = tempPart;
i = r>>8;
photons[y][x] = 0;
photons[y][x] = tempPart.type | i<<8;
elementCount[tempPart.type]++;
}
//Allocate new particle
@@ -141,9 +141,10 @@ int Simulation::Load(int fullX, int fullY, GameSave * save, bool includePressure
break;
i = pfree;
pfree = parts[i].life;
if (i>parts_lastActiveIndex) parts_lastActiveIndex = i;
if (i > parts_lastActiveIndex)
parts_lastActiveIndex = i;
parts[i] = tempPart;
pmap[y][x] = tempPart.type | i<<8;
elementCount[tempPart.type]++;
}

0 comments on commit e956e7c

Please sign in to comment.