Skip to content

Commit

Permalink
fix issue where stamps would stack if you loaded multiple in one frame
Browse files Browse the repository at this point in the history
sim.loadStamp in the console, or a lua script
  • Loading branch information
jacob1 committed Dec 4, 2017
1 parent 63c13bd commit e956e7c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/simulation/Simulation.cpp
Expand Up @@ -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
Expand All @@ -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]++;
}

Expand Down

0 comments on commit e956e7c

Please sign in to comment.