Fix "End of particles reached" not printing if manually simulating to particle 235008

This commit is contained in:
jacob1 2022-12-22 21:08:10 -05:00
parent 543bd5f5c0
commit 94406a4320
No known key found for this signature in database
GPG Key ID: 4E58A32D510E1995

View File

@ -23,9 +23,9 @@ void ParticleDebug::Debug(int mode, int x, int y)
if (!sim->NUM_PARTS)
return;
i = debug_currentParticle;
while (i < NPART && !sim->parts[i].type)
while (i < NPART - 1 && !sim->parts[i].type)
i++;
if (i == NPART)
if (i == NPART - 1)
logmessage = "End of particles reached, updated sim";
else
logmessage = String::Build("Updated particle #", i);