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

Function ResetObjectOntoTerrain

editor/MainFrm.cpp:2432–2449  ·  view source on GitHub ↗

Keep this around

Source from the content-addressed store, hash-verified

2430}
2431
2432// Keep this around
2433void ResetObjectOntoTerrain() {
2434 if (Cur_object_index != -1) {
2435
2436 object *objp = &Objects[Cur_object_index];
2437
2438 if (!OBJECT_OUTSIDE(objp)) {
2439 int roomnum = GetTerrainRoomFromPos(&objp->pos);
2440 ObjSetPos(objp, &objp->pos, roomnum, NULL, true);
2441
2442 EditorStatus("Object %d (\"%s\") moved to cell %d", OBJNUM(objp), objp->name ? objp->name : "<no name>",
2443 CELLNUM(roomnum));
2444
2445 World_changed = 1;
2446 } else
2447 EditorStatus("Object %d (\"%s\") already outside (on cell %d)", OBJNUM(objp),
2448 objp->name ? objp->name : "<no name>", CELLNUM(objp->roomnum));
2449 }
2450}
2451
2452// Keep this around

Callers

nothing calls this directly

Calls 3

GetTerrainRoomFromPosFunction · 0.85
ObjSetPosFunction · 0.85
EditorStatusFunction · 0.85

Tested by

no test coverage detected