Use Item pointer for Script resolving for item use script.
continuous-integration/drone/push Build is passing Details

Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
This commit is contained in:
Deukhoofd 2021-03-07 11:24:45 +01:00
parent d908efff9d
commit 3a4171f565
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
2 changed files with 6 additions and 3 deletions

View File

@ -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);)
};

View File

@ -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;
};
};
}