1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-13 16:23:38 +02:00

Don't remove non-player entities in scriptclass::hardreset()

When I moved duplicate player entity removal to
scriptclass::hardreset(), I also inadvertently made it so all non-player
entities got removed as well, even though this wasn't my intent. And
thus, pressing Enter to restart a time trial removes every entity except
the player, since it calls script.hardreset().

The time trial script.hardreset() is bad for other reasons (see #367),
however it's still a good idea to reset only what's needed in
script.hardreset().
This commit is contained in:
Misa 2020-07-11 12:21:24 -07:00 committed by Ethan Lee
parent 199a8f45d6
commit 582aaa587e

View File

@ -3713,7 +3713,7 @@ void scriptclass::hardreset()
// Remove duplicate player entities
for (int i = 0; i < (int) obj.entities.size(); i++)
{
if (i != theplayer)
if (obj.entities[i].rule == 0 && i != theplayer)
{
removeentity_iter(i);
theplayer--; // just in case indice of player is not 0