GoL is now affected by stasis wall

This commit is contained in:
jacob1 2019-02-20 23:25:28 -05:00
parent 45ee6780d9
commit 28bfa9dfc9

View File

@ -4938,7 +4938,8 @@ void Simulation::SimulateGoL()
if (TYP(r) == PT_LIFE)
{
int golnum = parts[ID(r)].ctype + 1;
if (golnum<=0 || golnum>NGOL) {
if (golnum <= 0 || golnum > NGOL)
{
kill_part(ID(r));
continue;
}
@ -4992,6 +4993,8 @@ void Simulation::SimulateGoL()
continue;
int neighbors = gol2[ny][nx][0];
if (neighbors)
{
if (!(bmap[ny/CELL][nx/CELL] == WL_STASIS && emap[ny/CELL][nx/CELL] < 8))
{
int golnum = gol[ny][nx];
if (!r)
@ -5004,7 +5007,8 @@ void Simulation::SimulateGoL()
golnum = (gol2[ny][nx][i]>>4);
if (grule[golnum][neighbors]>= 2 && (gol2[ny][nx][i]&0xF) >= (neighbors%2)+neighbors/2)
{
if (golnum<creategol) creategol=golnum;
if (golnum < creategol)
creategol = golnum;
}
}
if (creategol < 0xFF)
@ -5015,6 +5019,7 @@ void Simulation::SimulateGoL()
if (parts[ID(r)].tmp == grule[golnum][9]-1)
parts[ID(r)].tmp--;
}
}
for (int z = 0; z < 9; z++)
gol2[ny][nx][z] = 0;//this improves performance A LOT compared to the memset, i was getting ~23 more fps with this.
}