A bunch of work on the concept of script owners.
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
@@ -4,7 +4,7 @@ void PkmnLib::Battling::Battle::SetWeather(const ArbUt::StringView& name) {
|
||||
_weatherScript->OnRemove();
|
||||
}
|
||||
_weatherScript = std::unique_ptr<CreatureLib::Battling::BattleScript>(
|
||||
_library->LoadScript(static_cast<ScriptCategory>(PkmnScriptCategory::Weather), name));
|
||||
_library->LoadScript(this, static_cast<ScriptCategory>(PkmnScriptCategory::Weather), name));
|
||||
_eventHook.Trigger<WeatherChangeEvent>(name);
|
||||
}
|
||||
void PkmnLib::Battling::Battle::ClearWeather() {
|
||||
@@ -57,9 +57,9 @@ PkmnLib::Battling::Battle* PkmnLib::Battling::Battle::Clone() const {
|
||||
battle->_hasEnded = _hasEnded;
|
||||
battle->_battleResult = _battleResult;
|
||||
battle->_currentTurn = _currentTurn;
|
||||
_volatile.Clone(battle->_volatile);
|
||||
_volatile.Clone(battle, battle->_volatile);
|
||||
if (_weatherScript != nullptr) {
|
||||
battle->_weatherScript = std::unique_ptr<CreatureLib::Battling::BattleScript>(_weatherScript->Clone());
|
||||
battle->_weatherScript = std::unique_ptr<CreatureLib::Battling::BattleScript>(_weatherScript->Clone(battle));
|
||||
}
|
||||
|
||||
return battle;
|
||||
|
||||
Reference in New Issue
Block a user