Smart pointers for most library and battle classes.
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:
@@ -2,14 +2,13 @@
|
||||
void PkmnLib::Battling::Battle::SetWeather(const ArbUt::CaseInsensitiveConstString& name) {
|
||||
if (_weatherScript != nullptr) {
|
||||
_weatherScript->OnRemove();
|
||||
delete _weatherScript;
|
||||
}
|
||||
_weatherScript = _library->LoadScript(static_cast<ScriptCategory>(PkmnScriptCategory::Weather), name);
|
||||
_weatherScript = std::unique_ptr<CreatureLib::Battling::Script>(
|
||||
_library->LoadScript(static_cast<ScriptCategory>(PkmnScriptCategory::Weather), name));
|
||||
_eventHook.TriggerEvent(new WeatherChangeEvent(name));
|
||||
}
|
||||
void PkmnLib::Battling::Battle::ClearWeather() {
|
||||
_weatherScript->OnRemove();
|
||||
delete _weatherScript;
|
||||
_weatherScript = nullptr;
|
||||
_eventHook.TriggerEvent(new WeatherChangeEvent(""_cnc));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user