diff --git a/CInterface/Battling/Battle.cpp b/CInterface/Battling/Battle.cpp index 0a73868..85f1424 100644 --- a/CInterface/Battling/Battle.cpp +++ b/CInterface/Battling/Battle.cpp @@ -56,7 +56,7 @@ export BattleParty* const* CreatureLib_Battle_GetParties(const Battle* p) { } export Script* CreatureLib_Battle_GetVolatileScript(Battle* p, const char* key) { - return p->GetVolatileScript(ConstString::GetHash(key)); + return p->GetVolatileScript(ConstString::GetHash(key)).GetRaw(); } export uint8_t CreatureLib_Battle_AddVolatileScriptByName(Battle* p, const char* key) { Try(p->AddVolatileScript(ConstString(key));) diff --git a/src/Battling/Models/Battle.cpp b/src/Battling/Models/Battle.cpp index bed0e85..d7fa0d3 100644 --- a/src/Battling/Models/Battle.cpp +++ b/src/Battling/Models/Battle.cpp @@ -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()); } diff --git a/src/Battling/Models/Battle.hpp b/src/Battling/Models/Battle.hpp index e6b77e1..d701fa5 100644 --- a/src/Battling/Models/Battle.hpp +++ b/src/Battling/Models/Battle.hpp @@ -82,8 +82,8 @@ namespace CreatureLib::Battling { const ArbUt::UniquePtrList& GetParties() const noexcept { return _parties; } const ArbUt::UniquePtrList& 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