Only get active scripts from side if side exists.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2020-02-17 09:57:15 +01:00
parent 65f054bfab
commit 17552c33ca
Signed by: Deukhoofd
GPG Key ID: ADF2E9256009EDCE
2 changed files with 4 additions and 2 deletions

View File

@ -147,7 +147,9 @@ void Battling::Creature::GetActiveScripts(std::vector<ScriptWrapper>& scripts) {
scripts.emplace_back(&_activeTalent); scripts.emplace_back(&_activeTalent);
scripts.emplace_back(&_status); scripts.emplace_back(&_status);
scripts.emplace_back(&_volatile); scripts.emplace_back(&_volatile);
if (_side != nullptr) {
_side->GetActiveScripts(scripts); _side->GetActiveScripts(scripts);
}
} }
void Battling::Creature::ClearVolatileScripts() { _volatile.Clear(); } void Battling::Creature::ClearVolatileScripts() { _volatile.Clear(); }
void Battling::Creature::AddExperience(uint32_t amount) { void Battling::Creature::AddExperience(uint32_t amount) {

View File

@ -82,7 +82,7 @@ namespace CreatureLib::Battling {
protected: protected:
void GetActiveScripts(std::vector<ScriptWrapper>& scripts) override { void GetActiveScripts(std::vector<ScriptWrapper>& scripts) override {
scripts.emplace_back(&_script); scripts.emplace_back(&_script);
GetUser()->GetActiveScripts(scripts); _user->GetActiveScripts(scripts);
} }
}; };
} }