$$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 */
| 307 | $$END |
| 308 | */ |
| 309 | int 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 | // ============================================================ |
no test coverage detected