diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-04-17 15:45:05 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-04-17 15:45:05 (GMT) |
| commit | db1ffd3208808da53750348068151f46c5ef3bb5 (patch) | |
| tree | 6827fb1e0fce9f44dcd386ded378d1461e8204c1 /src/simulation/Simulation.cpp | |
| parent | 69e7dadcdf5daaddd663e67c54cc8dbd4a62eb0f (diff) | |
| download | powder-db1ffd3208808da53750348068151f46c5ef3bb5.zip powder-db1ffd3208808da53750348068151f46c5ef3bb5.tar.gz | |
TPT: Fix WARP destroying DMND a9c198dd46
Diffstat (limited to 'src/simulation/Simulation.cpp')
| -rw-r--r-- | src/simulation/Simulation.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp index b86b9a7..1fc99ed 100644 --- a/src/simulation/Simulation.cpp +++ b/src/simulation/Simulation.cpp @@ -2410,8 +2410,6 @@ void Simulation::update_particles_i(int start, int inc) for (i=0; i<=parts_lastActiveIndex; i++) if (parts[i].type) { - lx = parts[i].x; - ly = parts[i].y; t = parts[i].type; if (t<0 || t>=PT_NUM) { @@ -2826,12 +2824,21 @@ void Simulation::update_particles_i(int start, int inc) { if ((*(ptypes[t].update_func))(this, i,x,y,surround_space,nt, parts, pmap)) continue; + else if (t==PT_WARP) + { + // Warp does some movement in its update func, update variables to avoid incorrect data in pmap + x = (int)(parts[i].x+0.5f); + y = (int)(parts[i].y+0.5f); + } } #ifdef LUACONSOLE if(lua_el_mode[t]) { if(luacon_part_update(t,i,x,y,surround_space,nt)) continue; + // Need to update variables, in case they've been changed by Lua + x = (int)(parts[i].x+0.5f); + y = (int)(parts[i].y+0.5f); } #endif if (legacy_enable)//if heat sim is off |
