Fixes issue where GetAngelscriptOwner would return an invalid value.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -23,10 +23,7 @@ AngelScriptScript::AngelScriptScript(const ArbUt::OptionalBorrowedPtr<void>& own
|
||||
if (ownerType == nullptr) {
|
||||
THROW("Script was created with owner value, but with unknown owner type.")
|
||||
}
|
||||
CScriptHandle* handle = nullptr;
|
||||
AngelScriptUtils::AngelscriptFunctionCall(
|
||||
_type->GetGetOwner().Function, _ctxPool, _obj, _resolver, GetName(), [&](asIScriptContext*) {},
|
||||
[&](asIScriptContext* ctx) { handle = (CScriptHandle*)ctx->GetReturnAddress(); });
|
||||
auto* handle = GetAngelscriptOwner();
|
||||
handle->Set(owner.GetValue(), ownerType);
|
||||
}
|
||||
}
|
||||
@@ -35,7 +32,7 @@ CScriptHandle* AngelScriptScript::GetAngelscriptOwner() {
|
||||
CScriptHandle* handle = nullptr;
|
||||
AngelScriptUtils::AngelscriptFunctionCall(
|
||||
_type->GetGetOwner().Function, _ctxPool, _obj, _resolver, GetName(), [&](asIScriptContext*) {},
|
||||
[&](asIScriptContext* ctx) { handle = (CScriptHandle*)ctx->GetReturnObject(); });
|
||||
[&](asIScriptContext* ctx) { handle = (CScriptHandle*)ctx->GetReturnAddress(); });
|
||||
return handle;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user