From fbbc7552831b145ed9c977d58ff7e8002bda8786 Mon Sep 17 00:00:00 2001 From: jacob1 Date: Tue, 1 Sep 2015 01:27:03 -0400 Subject: [PATCH] resetting sparks resets any sparks in WIFI too --- src/gui/game/GameController.cpp | 1 + src/lua/TPTScriptInterface.cpp | 9 +-------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/gui/game/GameController.cpp b/src/gui/game/GameController.cpp index 8f35fc494..68e7d303b 100644 --- a/src/gui/game/GameController.cpp +++ b/src/gui/game/GameController.cpp @@ -821,6 +821,7 @@ void GameController::ResetSpark() else sim->kill_part(i); } + memset(sim->wireless, 0, sizeof(sim->wireless)); } void GameController::SwitchGravity() diff --git a/src/lua/TPTScriptInterface.cpp b/src/lua/TPTScriptInterface.cpp index aaeec105f..26a38d0df 100644 --- a/src/lua/TPTScriptInterface.cpp +++ b/src/lua/TPTScriptInterface.cpp @@ -560,14 +560,7 @@ AnyType TPTScriptInterface::tptS_reset(std::deque * words) } else if (resetStr == "sparks") { - for (int i = 0; i < NPART; i++) - { - if (sim->parts[i].type == PT_SPRK) - { - sim->parts[i].type = sim->parts[i].ctype; - sim->parts[i].life = 4; - } - } + c->ResetSpark(); } else if (resetStr == "temp") {