From 582aaa587e5a6f425a6018f1bbfdad1bbec3bcec Mon Sep 17 00:00:00 2001 From: Misa Date: Sat, 11 Jul 2020 12:21:24 -0700 Subject: [PATCH] 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(). --- desktop_version/src/Script.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop_version/src/Script.cpp b/desktop_version/src/Script.cpp index 538b983b..1e755fc7 100644 --- a/desktop_version/src/Script.cpp +++ b/desktop_version/src/Script.cpp @@ -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