Update to CreatureLib changes in event triggers.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2020-07-31 16:30:06 +02:00
parent f55033b8a2
commit efbb9429d7
Signed by: Deukhoofd
GPG Key ID: ADF2E9256009EDCE
2 changed files with 3 additions and 4 deletions

View File

@ -5,10 +5,10 @@ void PkmnLib::Battling::Battle::SetWeather(const ArbUt::StringView& name) {
} }
_weatherScript = std::unique_ptr<CreatureLib::Battling::Script>( _weatherScript = std::unique_ptr<CreatureLib::Battling::Script>(
_library->LoadScript(static_cast<ScriptCategory>(PkmnScriptCategory::Weather), name)); _library->LoadScript(static_cast<ScriptCategory>(PkmnScriptCategory::Weather), name));
_eventHook.TriggerEvent(new WeatherChangeEvent(name)); _eventHook.Trigger<WeatherChangeEvent>(name);
} }
void PkmnLib::Battling::Battle::ClearWeather() { void PkmnLib::Battling::Battle::ClearWeather() {
_weatherScript->OnRemove(); _weatherScript->OnRemove();
_weatherScript = nullptr; _weatherScript = nullptr;
_eventHook.TriggerEvent(new WeatherChangeEvent(""_cnc)); _eventHook.Trigger<WeatherChangeEvent>(""_cnc);
} }

View File

@ -3,7 +3,6 @@
#include <Arbutils/Enum.hpp> #include <Arbutils/Enum.hpp>
#include <CreatureLib/Battling/EventHooks/EventDataKind.hpp> #include <CreatureLib/Battling/EventHooks/EventDataKind.hpp>
ENUM_WITH_START_VALUE(PkmnEventDataKind, uint8_t, ((uint8_t)CreatureLib::Battling::EventDataKindHelper::Highest()) + 1, ENUM_WITH_START_VALUE(PkmnEventDataKind, uint8_t, 128, WeatherChange)
WeatherChange)
#endif // PKMNLIB_PKMNEVENTKIND_HPP #endif // PKMNLIB_PKMNEVENTKIND_HPP