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

Function ResetObjectsIntoMine

editor/MainFrm.cpp:2452–2478  ·  view source on GitHub ↗

Keep this around

Source from the content-addressed store, hash-verified

2450}
2451
2452// Keep this around
2453void ResetObjectsIntoMine() {
2454 int i, objnum, count = 0;
2455
2456 for (i = 0; i < TERRAIN_WIDTH * TERRAIN_DEPTH; i++) {
2457 if (TerrainSelected[i]) {
2458 for (objnum = Terrain_seg[i].objects; objnum != -1;) {
2459 object *objp = &Objects[objnum];
2460 int next = objp->next;
2461 if ((objp->type != OBJ_VIEWER) && (objp->type != OBJ_ROOM)) {
2462 int roomnum = FindPointRoom(&objp->pos);
2463 if (roomnum == -1)
2464 OutrageMessageBox("Can't find room for object %d (type = %s)", objnum, Object_type_names[objp->type]);
2465 else {
2466 mprintf(0, "Moving object %d to room %d\n", objnum, roomnum);
2467 ObjSetPos(&Objects[objnum], &objp->pos, roomnum, NULL, true);
2468 count++;
2469 }
2470 }
2471 objnum = next;
2472 }
2473 }
2474 }
2475
2476 OutrageMessageBox("%d objects were moved from the terrain to the mine.", count);
2477
2478 World_changed = 1;
2479}
2480
2481void DeleteAllFacesWithTexture1(room *rp) {

Callers

nothing calls this directly

Calls 3

FindPointRoomFunction · 0.85
OutrageMessageBoxFunction · 0.85
ObjSetPosFunction · 0.85

Tested by

no test coverage detected