From 3a4171f5654b6688506c14f8c3cd1312c8040f38 Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Sun, 7 Mar 2021 11:24:45 +0100 Subject: [PATCH] Use Item pointer for Script resolving for item use script. Signed-off-by: Deukhoofd --- CInterface/Battling/ScriptResolver.cpp | 4 ++-- src/Battling/ScriptHandling/ScriptResolver.hpp | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CInterface/Battling/ScriptResolver.cpp b/CInterface/Battling/ScriptResolver.cpp index 8d04638..f26cc86 100644 --- a/CInterface/Battling/ScriptResolver.cpp +++ b/CInterface/Battling/ScriptResolver.cpp @@ -15,6 +15,6 @@ export uint8_t CreatureLib_ScriptResolver_LoadScript(BattleScript*& out, ScriptR }; export uint8_t CreatureLib_ScriptResolver_LoadItemScript(ItemUseScript*& out, ScriptResolver* p, - const char* scriptName) { - Try(out = p->LoadItemScript(ArbUt::StringView(scriptName));) + const CreatureLib::Library::Item* item) { + Try(out = p->LoadItemScript(item);) }; diff --git a/src/Battling/ScriptHandling/ScriptResolver.hpp b/src/Battling/ScriptHandling/ScriptResolver.hpp index c6e54f4..87704f3 100644 --- a/src/Battling/ScriptHandling/ScriptResolver.hpp +++ b/src/Battling/ScriptHandling/ScriptResolver.hpp @@ -1,6 +1,7 @@ #ifndef CREATURELIB_SCRIPTRESOLVER_HPP #define CREATURELIB_SCRIPTRESOLVER_HPP +#include "../../Library/Items/Item.hpp" #include "BattleScript.hpp" #include "ItemUseScript.hpp" #include "ScriptCategory.hpp" @@ -21,7 +22,9 @@ namespace CreatureLib::Battling { return nullptr; }; - virtual ItemUseScript* LoadItemScript([[maybe_unused]] const ArbUt::StringView& scriptName) { return nullptr; }; + virtual ItemUseScript* LoadItemScript([[maybe_unused]] const CreatureLib::Library::Item* item) { + return nullptr; + }; }; }