Trigger event hook on weather change/
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,6 +2,7 @@
|
||||
#define PKMNLIB_BATTLE_HPP
|
||||
|
||||
#include <CreatureLib/Battling/Models/Battle.hpp>
|
||||
#include "../EventHooks/WeatherChangeEvent.hpp"
|
||||
#include "../Library/BattleLibrary.hpp"
|
||||
#include "../PkmnScriptCategory.hpp"
|
||||
|
||||
@@ -21,11 +22,13 @@ namespace PkmnLib::Battling {
|
||||
delete _weatherScript;
|
||||
}
|
||||
_weatherScript = _library->LoadScript(static_cast<ScriptCategory>(PkmnScriptCategory::Weather), name);
|
||||
_eventHook.TriggerEvent(new WeatherChangeEvent(name));
|
||||
}
|
||||
void ClearWeather() {
|
||||
_weatherScript->OnRemove();
|
||||
delete _weatherScript;
|
||||
_weatherScript = nullptr;
|
||||
_eventHook.TriggerEvent(new WeatherChangeEvent(""_cnc));
|
||||
}
|
||||
const Arbutils::CaseInsensitiveConstString& GetWeatherName() noexcept { return _weatherScript->GetName(); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user