MCPcopy Create free account
hub / github.com/adventuregamestudio/ags / ccGetScriptObjectAddress

Function ccGetScriptObjectAddress

Engine/script/script_runtime.cpp:116–141  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

114}
115
116bool ccGetScriptObjectAddress(const String &name, void *&obj_out, IScriptObject *&mgr_out)
117{
118 const auto *imp = simp.GetByName(name);
119 if (!imp)
120 return false;
121 if (imp->Value.Type != kScValScriptObject && imp->Value.Type != kScValPluginObject)
122 return false;
123
124 void *object;
125 IScriptObject *mgr;
126 if (imp->ValueHint == kScValHint_Handle)
127 {
128 const int32_t handle = *static_cast<const int32_t*>(imp->Value.Ptr);
129 if (ccGetObjectAddressAndManagerFromHandle(handle, object, mgr) == kScValUndefined)
130 return false;
131 }
132 else
133 {
134 object = imp->Value.Ptr;
135 mgr = imp->Value.ObjMgr;
136 }
137
138 obj_out = object;
139 mgr_out = mgr;
140 return true;
141}
142
143void *ccGetScriptObjectAddress(const String &name, const String &type)
144{

Callers 8

GUI_GetByNameFunction · 0.85
AudioClip_GetByNameFunction · 0.85
Object_GetByNameFunction · 0.85
InventoryItem_GetByNameFunction · 0.85
Character_GetByNameFunction · 0.85
GUIControl_GetByNameFunction · 0.85
Hotspot_GetByNameFunction · 0.85
Dialog_GetByNameFunction · 0.85

Calls 3

GetByNameMethod · 0.80
GetTypeMethod · 0.45

Tested by

no test coverage detected