Fixes item use scripts not being properly initialised, and not setting its owner
This commit is contained in:
parent
1639a132a9
commit
ad733d92c6
|
@ -60,7 +60,7 @@ private:
|
|||
}
|
||||
|
||||
FunctionInfo InitializeSetOwner() {
|
||||
auto val = _scriptObject->GetObjectType()->GetMethodByDecl("void SetOwner(ref@ owner)", true);
|
||||
auto val = _scriptObject->GetObjectType()->GetMethodByDecl("void SetOwner(const Item@ owner)", true);
|
||||
if (val != nullptr) {
|
||||
return FunctionInfo{.Exists = true, .Function = val};
|
||||
}
|
||||
|
@ -73,7 +73,7 @@ private:
|
|||
#define ITEM_USE_SCRIPT_HOOK_FUNCTION(name, decl) FunctionInfo __##name = Initialize(decl)
|
||||
|
||||
ITEM_USE_SCRIPT_HOOK_FUNCTION(
|
||||
OnInitialize, "void OnInitialize(const BattleLibrary@ library, const narray<EffectParameter@>@ parameters)");
|
||||
OnInitialize, "void OnInitialize(const narray<EffectParameter@>@ parameters)");
|
||||
ITEM_USE_SCRIPT_HOOK_FUNCTION(IsItemUsable, "bool IsItemUsable()");
|
||||
ITEM_USE_SCRIPT_HOOK_FUNCTION(IsPokemonUseItem, "bool IsPokemonUseItem()");
|
||||
ITEM_USE_SCRIPT_HOOK_FUNCTION(IsUseValidForPokemon, "bool IsUseValidForPokemon(Pokemon@ target)");
|
||||
|
|
Loading…
Reference in New Issue