Reset active scripts on Creature when battle is set.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2020-02-17 10:05:32 +01:00
parent 17552c33ca
commit da90c3d59e
Signed by: Deukhoofd
GPG Key ID: ADF2E9256009EDCE
2 changed files with 5 additions and 0 deletions

View File

@ -37,6 +37,7 @@ const std::string& Battling::Creature::GetActiveTalent() const {
void Battling::Creature::SetBattleData(Battling::Battle* battle, Battling::BattleSide* side) {
_battle = battle;
_side = side;
this->ResetActiveScripts();
}
// region Stat APIs

View File

@ -12,6 +12,10 @@ namespace CreatureLib::Battling {
protected:
virtual void GetActiveScripts(std::vector<ScriptWrapper>& scripts) = 0;
void ResetActiveScripts() {
_areScriptsInitialized = false;
_scripts.clear();
}
public:
ScriptAggregator GetScriptIterator() {