From f816975b63240a52b839eb459ed42afd43724c01 Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Fri, 2 Oct 2020 17:43:16 +0200 Subject: [PATCH] Fix for Pokemon::ClearStatus crashing when a Pokemon does not have a status. Now will just do nothing. --- src/Battling/Pokemon/Pokemon.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Battling/Pokemon/Pokemon.cpp b/src/Battling/Pokemon/Pokemon.cpp index b72a734..12b4a4b 100644 --- a/src/Battling/Pokemon/Pokemon.cpp +++ b/src/Battling/Pokemon/Pokemon.cpp @@ -39,6 +39,8 @@ void PkmnLib::Battling::Pokemon::SetStatus(const ArbUt::StringView& name) { } } void PkmnLib::Battling::Pokemon::ClearStatus() { + if (_statusScript == nullptr) + return; _statusScript->OnRemove(); _statusScript = nullptr; if (_battle != nullptr) {