mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-10 02:16:37 +02:00
minor efficiency fix
This commit is contained in:
@@ -4108,6 +4108,11 @@ void Simulation::UpdateParticles(int start, int end)
|
|||||||
if ((elements[t].Properties&TYPE_GAS) && !(elements[parts[i].type].Properties&TYPE_GAS))
|
if ((elements[t].Properties&TYPE_GAS) && !(elements[parts[i].type].Properties&TYPE_GAS))
|
||||||
pv[y/CELL][x/CELL] += 0.50f;
|
pv[y/CELL][x/CELL] += 0.50f;
|
||||||
|
|
||||||
|
if (t == PT_NONE)
|
||||||
|
{
|
||||||
|
kill_part(i);
|
||||||
|
goto killed;
|
||||||
|
}
|
||||||
if (part_change_type(i,x,y,t))
|
if (part_change_type(i,x,y,t))
|
||||||
goto killed;
|
goto killed;
|
||||||
// part_change_type could refuse to change the type and kill the particle
|
// part_change_type could refuse to change the type and kill the particle
|
||||||
@@ -4242,6 +4247,11 @@ void Simulation::UpdateParticles(int start, int end)
|
|||||||
// particle type change occurred
|
// particle type change occurred
|
||||||
if (s)
|
if (s)
|
||||||
{
|
{
|
||||||
|
if (t == PT_NONE)
|
||||||
|
{
|
||||||
|
kill_part(i);
|
||||||
|
goto killed;
|
||||||
|
}
|
||||||
parts[i].life = 0;
|
parts[i].life = 0;
|
||||||
// part_change_type could refuse to change the type and kill the particle
|
// part_change_type could refuse to change the type and kill the particle
|
||||||
// for example, changing type to STKM but one already exists
|
// for example, changing type to STKM but one already exists
|
||||||
|
Reference in New Issue
Block a user