From de171fea6d78f8b7215d92e1c140bc18f69d7e2c Mon Sep 17 00:00:00 2001 From: mathusummut Date: Thu, 7 Mar 2019 09:41:59 +0100 Subject: [PATCH] Fixed potential code bugs --- source/game/game/script_manager.cpp | 2 -- source/game/world/world.cpp | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/game/game/script_manager.cpp b/source/game/game/script_manager.cpp index 9d4838968..8f0110112 100644 --- a/source/game/game/script_manager.cpp +++ b/source/game/game/script_manager.cpp @@ -1769,8 +1769,6 @@ namespace Game { Unit * unit = world->findUnitById(unitId); if (unit != NULL) { - // Make sure they die - bool unit_dead = unit->decHp(unit->getHp() * unit->getHp()); unit->kill(); // If called from an existing die event we get a stack overflow //onUnitDied(unit); diff --git a/source/game/world/world.cpp b/source/game/world/world.cpp index 46968c994..cc2674269 100644 --- a/source/game/world/world.cpp +++ b/source/game/world/world.cpp @@ -1465,6 +1465,8 @@ namespace Game { } else { if (throwOnError) throw game_runtime_error("Invalid position command: " + commandName, true); + else + return; } if (unit->getType()->getFirstCtOfClass(cc) == NULL) {