Rework script handling to use smart pointers properly
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2022-05-14 16:07:32 +02:00
parent 0117cb9d64
commit de6d39376f
17 changed files with 85 additions and 77 deletions

View File

@@ -44,7 +44,8 @@ const std::unique_ptr<const DamageLibrary>& BattleLibrary::GetDamageLibrary() co
const std::unique_ptr<const MiscLibrary>& BattleLibrary::GetMiscLibrary() const noexcept { return _miscLibrary; }
BattleScript* nullable BattleLibrary::LoadScript(const ArbUt::OptionalBorrowedPtr<void>& owner, ScriptCategory category,
const ArbUt::StringView& scriptName) const {
return _scriptResolver->LoadScript(owner, category, scriptName);
ArbUt::OptionalUniquePtr<BattleScript> BattleLibrary::LoadScript(const ArbUt::OptionalBorrowedPtr<void>& owner,
ScriptCategory category,
const ArbUt::StringView& scriptName) const {
return _scriptResolver->LoadScript(owner, category, scriptName).TakeOwnership();
}