Fixed potential code bugs

This commit is contained in:
mathusummut
2019-03-07 09:41:59 +01:00
parent 14811e5964
commit de171fea6d
2 changed files with 2 additions and 2 deletions

View File

@@ -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);

View File

@@ -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) {