diff options
| author | jacob1 <jfu614@gmail.com> | 2012-12-23 23:17:04 (GMT) |
|---|---|---|
| committer | jacob1 <jfu614@gmail.com> | 2012-12-23 23:17:04 (GMT) |
| commit | 312dd8c0ba3f08bd1ae1e4f396387be4942cb493 (patch) | |
| tree | 5fb65b603691374ea799afc8baad845ce78d96b3 /src/simulation/Simulation.cpp | |
| parent | a91459916d016d1e10708373f44c116bb77eb407 (diff) | |
| download | powder-312dd8c0ba3f08bd1ae1e4f396387be4942cb493.zip powder-312dd8c0ba3f08bd1ae1e4f396387be4942cb493.tar.gz | |
revert stickmen CONV fix, and do it another way that doesn't crash
Diffstat (limited to 'src/simulation/Simulation.cpp')
| -rw-r--r-- | src/simulation/Simulation.cpp | 39 |
1 files changed, 31 insertions, 8 deletions
diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp index 69f12c7..a30fea8 100644 --- a/src/simulation/Simulation.cpp +++ b/src/simulation/Simulation.cpp @@ -2614,16 +2614,16 @@ void Simulation::kill_part(int i)//kills particle number i { player.spwn = 0; } - if (parts[i].type == PT_STKM2) + else if (parts[i].type == PT_STKM2) { player2.spwn = 0; } - if (parts[i].type == PT_FIGH) + else if (parts[i].type == PT_FIGH) { fighters[(unsigned char)parts[i].tmp].spwn = 0; fighcount--; } - if (parts[i].type == PT_SOAP) + else if (parts[i].type == PT_SOAP) { detach(i); } @@ -2642,15 +2642,15 @@ void Simulation::part_change_type(int i, int x, int y, int t)//changes the type if (parts[i].type == PT_STKM) player.spwn = 0; - - if (parts[i].type == PT_STKM2) + else if (parts[i].type == PT_STKM2) player2.spwn = 0; - - if (parts[i].type == PT_FIGH) + else if (parts[i].type == PT_FIGH) { fighters[(unsigned char)parts[i].tmp].spwn = 0; fighcount--; } + else if (parts[i].type == PT_SOAP) + detach(i); parts[i].type = t; if (elements[t].Properties & TYPE_ENERGY) @@ -2846,7 +2846,30 @@ int Simulation::create_part(int p, int x, int y, int tv) } else { - kill_part(p); + int oldX = (int)(parts[p].x+0.5f); + int oldY = (int)(parts[p].y+0.5f); + if ((pmap[oldY][oldX]>>8)==p) + pmap[oldY][oldX] = 0; + if ((photons[oldY][oldX]>>8)==p) + photons[oldY][oldX] = 0; + + if (parts[p].type == PT_STKM) + { + player.spwn = 0; + } + else if (parts[p].type == PT_STKM2) + { + player2.spwn = 0; + } + else if (parts[p].type == PT_FIGH) + { + fighters[(unsigned char)parts[i].tmp].spwn = 0; + fighcount--; + } + else if (parts[p].type == PT_SOAP) + { + detach(i); + } i = p; } |
