Clear scripts from creature when a battle is cleared from it.
continuous-integration/drone/push Build is passing Details

Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
This commit is contained in:
Deukhoofd 2021-01-15 16:31:47 +01:00
parent 66b95a6e4d
commit 987f60ee85
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
2 changed files with 5 additions and 1 deletions

View File

@ -104,6 +104,7 @@ namespace CreatureLib::Battling {
_battle = nullptr;
_side = nullptr;
_seenOpponents = {};
ResetActiveScripts();
}
bool Creature::ChangeStatBoost(Library::Statistic stat, int8_t diffAmount) {

View File

@ -13,7 +13,10 @@ namespace CreatureLib::Battling {
protected:
virtual void GetActiveScripts(ArbUt::List<ScriptWrapper>& scripts) = 0;
void ResetActiveScripts() { _areScriptsInitialized = false; }
void ResetActiveScripts() {
_areScriptsInitialized = false;
_scripts.Clear();
}
public:
virtual size_t ScriptCount() const = 0;