Defensive programming.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -21,7 +21,11 @@ namespace PkmnLib::Battling {
|
||||
|
||||
void SetWeather(const ArbUt::StringView& name);
|
||||
void ClearWeather();
|
||||
const ArbUt::StringView& GetWeatherName() noexcept { return _weatherScript->GetName(); }
|
||||
const ArbUt::StringView& GetWeatherName() noexcept {
|
||||
if (_weatherScript == nullptr)
|
||||
return ArbUt::StringView::EmptyString();
|
||||
return _weatherScript->GetName();
|
||||
}
|
||||
|
||||
size_t ScriptCount() const override { return CreatureLib::Battling::Battle::ScriptCount() + 1; }
|
||||
void GetActiveScripts(ArbUt::List<CreatureLib::Battling::ScriptWrapper>& scripts) override {
|
||||
|
||||
Reference in New Issue
Block a user