MCPcopy Create free account
hub / github.com/GarageGames/Torque3D / script_simobject_find

Function script_simobject_find

Engine/source/cinterface/c_scripting.cpp:305–329  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

303 }
304
305 S32 script_simobject_find(const char* classname, const char* name)
306 {
307 SimObject *object;
308 if( Sim::findObject( name, object ) )
309 {
310 // if we specified a classname do type checking
311 if (classname && dStrlen(classname))
312 {
313 AbstractClassRep* ocr = object->getClassRep();
314 while (ocr)
315 {
316 if (!dStricmp(ocr->getClassName(), classname))
317 return object->getId();
318 ocr = ocr->getParentClass();
319 }
320
321 }
322
323 // invalid type
324 return 0;
325 }
326
327 // didn't find object
328 return 0;
329 }
330
331 void script_export_callback_string(StringCallback cb, const char *nameSpace, const char *funcName, const char* usage, S32 minArgs, S32 maxArgs)
332 {

Callers

nothing calls this directly

Calls 7

dStricmpFunction · 0.85
getClassRepMethod · 0.80
getParentClassMethod · 0.80
findObjectFunction · 0.50
dStrlenFunction · 0.50
getClassNameMethod · 0.45
getIdMethod · 0.45

Tested by

no test coverage detected