From 0f6d538695a4da6e026bc2e390308c48c0e2473f Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Sat, 30 Oct 2021 00:19:24 +0200 Subject: [PATCH] Make GetOwner angelscript func return a reference to the ref. --- src/ScriptResolving/AngelScript/AngelScriptTypeInfo.hpp | 2 +- .../AngelScript/TypeRegistry/BasicScriptClass.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ScriptResolving/AngelScript/AngelScriptTypeInfo.hpp b/src/ScriptResolving/AngelScript/AngelScriptTypeInfo.hpp index 2ea8585..7645a0f 100644 --- a/src/ScriptResolving/AngelScript/AngelScriptTypeInfo.hpp +++ b/src/ScriptResolving/AngelScript/AngelScriptTypeInfo.hpp @@ -75,7 +75,7 @@ private: FunctionInfo InitializeGetOwner(){ auto t = _type; while (t != nullptr){ - auto val = t->GetMethodByDecl("protected ref@ GetOwner()", false); + auto val = t->GetMethodByDecl("protected ref@& GetOwner()", false); if (val != nullptr){ return FunctionInfo{.Exists = true, .Function = val}; } diff --git a/src/ScriptResolving/AngelScript/TypeRegistry/BasicScriptClass.cpp b/src/ScriptResolving/AngelScript/TypeRegistry/BasicScriptClass.cpp index 099d7c2..7d6c537 100644 --- a/src/ScriptResolving/AngelScript/TypeRegistry/BasicScriptClass.cpp +++ b/src/ScriptResolving/AngelScript/TypeRegistry/BasicScriptClass.cpp @@ -7,7 +7,7 @@ void BasicScriptClass::Register(asIScriptEngine* engine) { shared abstract class PkmnScript { private ref@ __owner; - protected ref@ GetOwner() { return __owner; }; + protected ref@& GetOwner() { return __owner; }; // CreatureLib methods void OnInitialize(const narray@ parameters){};