MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / qCustomCreateObjectAtObject

Function qCustomCreateObjectAtObject

scripts/Mysterious_Isle.cpp:309–327  ·  view source on GitHub ↗

$$QUERY Custom o:Create an object of type [e:ObjectType] and ID [i:ObjectID] at object [o:ObjectDest] qCustomCreateObjectAtObject Creates an object of a specified type/id at the location of a specified object $$END */

Source from the content-addressed store, hash-verified

307$$END
308*/
309int qCustomCreateObjectAtObject(int type, int id, int handle) {
310 int handletype;
311 int room;
312 vector pos;
313 matrix orient;
314
315 if ((type != OBJ_ROBOT && type != OBJ_CLUTTER && type != OBJ_BUILDING && type != OBJ_POWERUP) || (id < 0))
316 return OBJECT_HANDLE_NONE;
317
318 Obj_Value(handle, VF_GET, OBJV_I_TYPE, &handletype);
319 if (handletype == OBJ_NONE)
320 return OBJECT_HANDLE_NONE;
321
322 Obj_Value(handle, VF_GET, OBJV_I_ROOMNUM, &room);
323 Obj_Value(handle, VF_GET, OBJV_V_POS, &pos);
324 Obj_Value(handle, VF_GET, OBJV_M_ORIENT, &orient);
325
326 return Obj_Create(type, id, room, &pos, &orient, OBJECT_HANDLE_NONE);
327}
328
329/**{CUSTOM_SCRIPT_BLOCK_END}**** DO NOT EDIT! **/
330// ============================================================

Callers 1

CallEventMethod · 0.85

Calls 2

Obj_ValueFunction · 0.85
Obj_CreateFunction · 0.85

Tested by

no test coverage detected