Use unique pointers in scriptset.
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:
@@ -137,7 +137,7 @@ void Battle::AddVolatileScript(const ConstString& key) {
|
||||
ss << "Invalid volatile script requested for battle: '" << key.c_str() << "'.";
|
||||
throw CreatureException(ss.str());
|
||||
}
|
||||
return _volatile.Add(script);
|
||||
return _volatile.Add(script.GetRaw());
|
||||
}
|
||||
void Battle::AddVolatileScript(Script* script) { return _volatile.Add(script); }
|
||||
void Battle::RemoveVolatileScript(Script* script) { _volatile.Remove(script->GetName()); }
|
||||
|
||||
@@ -82,8 +82,8 @@ namespace CreatureLib::Battling {
|
||||
|
||||
const ArbUt::UniquePtrList<BattleParty>& GetParties() const noexcept { return _parties; }
|
||||
const ArbUt::UniquePtrList<BattleSide>& GetSides() const noexcept { return _sides; }
|
||||
Script* GetVolatileScript(const ConstString& key) const { return _volatile.Get(key); }
|
||||
Script* GetVolatileScript(uint32_t keyHash) const noexcept { return _volatile.Get(keyHash); }
|
||||
ArbUt::BorrowedPtr<Script> GetVolatileScript(const ConstString& key) const { return _volatile.Get(key); }
|
||||
ArbUt::BorrowedPtr<Script> GetVolatileScript(uint32_t keyHash) const noexcept { return _volatile.Get(keyHash); }
|
||||
void AddVolatileScript(const ConstString& key);
|
||||
void AddVolatileScript(Script* script);
|
||||
void RemoveVolatileScript(const ConstString& name) { _volatile.Remove(name); }
|
||||
|
||||
@@ -225,7 +225,7 @@ void Battling::Creature::AddVolatileScript(const ConstString& name) {
|
||||
ss << "Invalid volatile script requested for creature: '" << name.c_str() << "'.";
|
||||
throw CreatureException(ss.str());
|
||||
}
|
||||
_volatile.Add(script);
|
||||
_volatile.Add(script.GetRaw());
|
||||
}
|
||||
|
||||
void Battling::Creature::AddVolatileScript(Script* script) { _volatile.Add(script); }
|
||||
|
||||
Reference in New Issue
Block a user