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

Function RemapObjects

Descent3/objinfo.cpp:329–345  ·  view source on GitHub ↗

Go through the object list and update an ID which has changed

Source from the content-addressed store, hash-verified

327
328// Go through the object list and update an ID which has changed
329void RemapObjects(int old_id, int new_id) {
330 int i;
331
332 for (i = 0; i < MAX_OBJECTS; i++)
333 if ((Objects[i].type == Object_info[new_id].type) && (Objects[i].id == old_id))
334 Objects[i].id = new_id;
335
336 for (i = 0; i < MAX_OBJECT_IDS; i++) {
337 if (Object_info[i].type != OBJ_NONE) {
338 int j;
339
340 for (j = 0; j < MAX_DSPEW_TYPES; j++)
341 if (Object_info[i].dspew[j] == old_id)
342 Object_info[i].dspew[j] = new_id;
343 }
344 }
345}
346
347// Remap all the static object ids (objects that must have a specific index) into their assigned slots.
348void RemapStaticIDs() {

Callers 1

RemapStaticIDsFunction · 0.85

Calls 1

RemapStaticIDsFunction · 0.85

Tested by

no test coverage detected