Fix for Pokemon::ClearStatus crashing when a Pokemon does not have a status. Now will just do nothing.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2020-10-02 17:43:16 +02:00
parent 64c5a94800
commit f816975b63
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
1 changed files with 2 additions and 0 deletions

View File

@ -39,6 +39,8 @@ void PkmnLib::Battling::Pokemon::SetStatus(const ArbUt::StringView& name) {
} }
} }
void PkmnLib::Battling::Pokemon::ClearStatus() { void PkmnLib::Battling::Pokemon::ClearStatus() {
if (_statusScript == nullptr)
return;
_statusScript->OnRemove(); _statusScript->OnRemove();
_statusScript = nullptr; _statusScript = nullptr;
if (_battle != nullptr) { if (_battle != nullptr) {