1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-23 15:40:42 +00:00

some missing cleanup

This commit is contained in:
Marc Zinnschlag 2014-04-29 19:56:33 +02:00
parent 9a1b5dc1c6
commit 0c2843b0f7
3 changed files with 10 additions and 0 deletions

View File

@ -532,4 +532,9 @@ namespace MWMechanics
{ {
return mActorId!=-1 && id==mActorId; return mActorId!=-1 && id==mActorId;
} }
void CreatureStats::cleanup()
{
sActorId = 0;
}
} }

View File

@ -248,6 +248,8 @@ namespace MWMechanics
bool matchesActorId (int id) const; bool matchesActorId (int id) const;
///< Check if \a id matches the actor ID of *this (if the actor does not have an ID ///< Check if \a id matches the actor ID of *this (if the actor does not have an ID
/// assigned this function will return false). /// assigned this function will return false).
static void cleanup();
}; };
} }

View File

@ -28,6 +28,7 @@
#include "../mwworld/inventorystore.hpp" #include "../mwworld/inventorystore.hpp"
#include "../mwmechanics/npcstats.hpp" #include "../mwmechanics/npcstats.hpp"
#include "../mwmechanics/creaturestats.hpp"
#include "../mwscript/globalscripts.hpp" #include "../mwscript/globalscripts.hpp"
@ -46,6 +47,8 @@ void MWState::StateManager::cleanup (bool force)
mState = State_NoGame; mState = State_NoGame;
mCharacterManager.clearCurrentCharacter(); mCharacterManager.clearCurrentCharacter();
mTimePlayed = 0; mTimePlayed = 0;
MWMechanics::CreatureStats::cleanup();
} }
} }