Slight optimization and defensive programming.
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
This commit is contained in:
parent
ede314ef39
commit
475e2142c6
|
@ -19,7 +19,10 @@ AngelScriptScript::AngelScriptScript(const ArbUt::OptionalBorrowedPtr<void>& own
|
||||||
AngelScriptResolver* resolver, AngelScriptTypeInfo* type, asIScriptObject* obj,
|
AngelScriptResolver* resolver, AngelScriptTypeInfo* type, asIScriptObject* obj,
|
||||||
ContextPool* ctxPool)
|
ContextPool* ctxPool)
|
||||||
: PkmnLib::Battling::PkmnScript(owner), _resolver(resolver), _type(type), _ctxPool(ctxPool), _obj(obj) {
|
: PkmnLib::Battling::PkmnScript(owner), _resolver(resolver), _type(type), _ctxPool(ctxPool), _obj(obj) {
|
||||||
if (_type->GetGetOwner().Exists) {
|
if (_type->GetGetOwner().Exists && owner.HasValue()) {
|
||||||
|
if (ownerType == nullptr){
|
||||||
|
THROW("Script was created with owner value, but with unknown owner type.")
|
||||||
|
}
|
||||||
CScriptHandle* handle = nullptr;
|
CScriptHandle* handle = nullptr;
|
||||||
AngelScriptUtils::AngelscriptFunctionCall(
|
AngelScriptUtils::AngelscriptFunctionCall(
|
||||||
_type->GetGetOwner().Function, _ctxPool, _obj, _resolver, GetName(), [&](asIScriptContext*) {},
|
_type->GetGetOwner().Function, _ctxPool, _obj, _resolver, GetName(), [&](asIScriptContext*) {},
|
||||||
|
|
Loading…
Reference in New Issue