From 1217432561eb6751382151b84569c8ca35ca523a Mon Sep 17 00:00:00 2001 From: fgenesis Date: Wed, 13 Mar 2013 23:28:38 +0100 Subject: [PATCH] allow arbitrary damage type IDs in shots instead of only "DT_*" string constants --- Aquaria/Game.cpp | 4 ++-- Aquaria/Shot.cpp | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Aquaria/Game.cpp b/Aquaria/Game.cpp index 0c20846..5583d05 100644 --- a/Aquaria/Game.cpp +++ b/Aquaria/Game.cpp @@ -6252,7 +6252,7 @@ void Game::applyState() core->afterEffectManager->clear(); //core->afterEffectManager->addEffect(new RippleEffect()); } - Shot::shots.clear(); + Shot::shots.clear(); // the shots were deleted elsewhere, drop any remaining pointers Shot::deleteShots.clear(); backdropQuad = 0; clearObsRows(); @@ -10887,7 +10887,7 @@ void Game::removeState() debugLog("killAllShots"); Shot::killAllShots(); - Shot::clearShotGarbage(); + Shot::clearShotGarbage(); // make sure there are no pointers left (would lead to a crash on shutdown otherwise) debugLog("killAllBeams"); Beam::killAllBeams(); debugLog("killAllWebs"); diff --git a/Aquaria/Shot.cpp b/Aquaria/Shot.cpp index 12a33cc..b52b762 100644 --- a/Aquaria/Shot.cpp +++ b/Aquaria/Shot.cpp @@ -230,6 +230,8 @@ void ShotData::bankLoad(const std::string &file, const std::string &path) damageType = DT_ENEMY_CREATOR; else if (bt == "DT_ENEMY_MANTISBOMB") damageType = DT_ENEMY_MANTISBOMB; + else + damageType = (DamageType)atoi(bt.c_str()); } else if (token == "Invisible") inf >> invisible;