diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp index e46681dae..8dff706f8 100644 --- a/src/simulation/Simulation.cpp +++ b/src/simulation/Simulation.cpp @@ -3230,34 +3230,12 @@ void Simulation::update_particles_i(int start, int inc) int h_count = 0; int surround[8]; int surround_hconduct[8]; - int lighting_ok=1; unsigned int elem_properties; float pGravX, pGravY, pGravD; int excessive_stacking_found = 0; currentTick++; - if (lighting_recreate>0) - { - for (i=0; i<=parts_lastActiveIndex; i++) - { - if (parts[i].type==PT_LIGH && parts[i].tmp2>0) - { - lighting_ok=0; - break; - } - } - } - - if (lighting_ok) - lighting_recreate--; - - if (lighting_recreate<0) - lighting_recreate=1; - - if (lighting_recreate>21) - lighting_recreate=21; - //if (sys_pause&&!framerender)//do nothing if paused // return; @@ -3815,7 +3793,7 @@ void Simulation::update_particles_i(int start, int inc) if ((t==PT_ICEI || t==PT_SNOW) && (parts[i].ctype<=0 || parts[i].ctype>=PT_NUM || parts[i].ctype==PT_ICEI || parts[i].ctype==PT_SNOW || !elements[parts[i].ctype].Enabled)) parts[i].ctype = PT_WATR; - if (ctemph>elements[t].HighTemperature && elements[t].HighTemperatureTransition>-1) + if (elements[t].HighTemperatureTransition>-1 && ctemph>elements[t].HighTemperature) { // particle type change due to high temperature #ifdef REALISTIC @@ -3911,7 +3889,7 @@ void Simulation::update_particles_i(int start, int inc) else s = 0; } - else if (ctempl -1) + else if (elements[t].LowTemperatureTransition > -1 && ctemplelements[t].HighPressure&&elements[t].HighPressureTransition>-1) { + if (elements[t].HighPressureTransition>-1 && pv[y/CELL][x/CELL]>elements[t].HighPressure) { // particle type change due to high pressure if (elements[t].HighPressureTransition!=PT_NUM) t = elements[t].HighPressureTransition; @@ -4107,12 +4085,12 @@ void Simulation::update_particles_i(int start, int inc) else s = 0; } else s = 0; - } else if (pv[y/CELL][x/CELL]-1) { + } else if (elements[t].LowPressureTransition>-1 && pv[y/CELL][x/CELL](elements[t].HighPressure/4.0f)&&elements[t].HighPressureTransition>-1) { + } else if (elements[t].HighPressureTransition>-1 && gravtot>(elements[t].HighPressure/4.0f)) { // particle type change due to high gravity if (elements[t].HighPressureTransition!=PT_NUM) t = elements[t].HighPressureTransition; @@ -4125,12 +4103,16 @@ void Simulation::update_particles_i(int start, int inc) } else s = 0; } else s = 0; - if (s) { // particle type change occurred + + // particle type change occurred + if (s) + { parts[i].life = 0; part_change_type(i,x,y,t); if (t==PT_FIRE) parts[i].life = rand()%50+120; - if (t==PT_NONE) { + if (t==PT_NONE) + { kill_part(i); goto killed; } @@ -4781,7 +4763,6 @@ Simulation::Simulation(): pretty_powder(0), sandcolour_frame(0), emp_decor(0), - lighting_recreate(0), force_stacking_check(0), ISWIRE(0), gravWallChanged(false), diff --git a/src/simulation/Simulation.h b/src/simulation/Simulation.h index 4c4ee953c..31185f614 100644 --- a/src/simulation/Simulation.h +++ b/src/simulation/Simulation.h @@ -66,7 +66,6 @@ public: playerst player2; playerst fighters[256]; //255 is the maximum number of fighters unsigned char fighcount; //Contains the number of fighters - int lighting_recreate; bool gravWallChanged; //Portals and Wifi Particle portalp[CHANNELS][8][80];