Fixes for ScriptSet throwing when adding a not yet found volatile script.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
This commit is contained in:
@@ -155,15 +155,15 @@ void Battle::ValidateBattleState() {
|
||||
}
|
||||
BattleScript* Battle::AddVolatileScript(const ArbUt::StringView& key) {
|
||||
auto script = _volatile.Get(key);
|
||||
if (script.has_value()) {
|
||||
script.value()->Stack();
|
||||
return script.value();
|
||||
if (script.HasValue()) {
|
||||
script.GetValue()->Stack();
|
||||
return script.GetValue();
|
||||
}
|
||||
script = _library->LoadScript(ScriptCategory::Battle, key);
|
||||
if (!script.has_value()) {
|
||||
if (!script.HasValue()) {
|
||||
THROW("Invalid volatile script requested for battle: '" << key.c_str() << "'.");
|
||||
}
|
||||
return _volatile.Add(script.value().GetRaw());
|
||||
return _volatile.Add(script.GetValue());
|
||||
}
|
||||
BattleScript* Battle::AddVolatileScript(BattleScript* script) { return _volatile.Add(script); }
|
||||
void Battle::RemoveVolatileScript(BattleScript* script) { _volatile.Remove(script->GetName()); }
|
||||
|
||||
Reference in New Issue
Block a user