Bunch of fixes for Owners of scripts.
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:
@@ -20,13 +20,13 @@ AngelScriptScript::AngelScriptScript(const ArbUt::OptionalBorrowedPtr<void>& own
|
||||
ContextPool* ctxPool)
|
||||
: PkmnLib::Battling::PkmnScript(owner), _resolver(resolver), _type(type), _ctxPool(ctxPool), _obj(obj) {
|
||||
if (_type->GetGetOwner().Exists && owner.HasValue()) {
|
||||
if (ownerType == nullptr){
|
||||
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->GetReturnObject(); });
|
||||
[&](asIScriptContext* ctx) { handle = (CScriptHandle*)ctx->GetReturnAddress(); });
|
||||
handle->Set(owner.GetValue(), ownerType);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user