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

Function GetNextObjectID

Descent3/objinfo.cpp:249–268  ·  view source on GitHub ↗

Gets next object from n of the same type as n

Source from the content-addressed store, hash-verified

247
248// Gets next object from n of the same type as n
249int GetNextObjectID(int n) {
250 int i;
251 int type = Object_info[n].type;
252
253 ASSERT(n >= 0 && n < MAX_OBJECT_IDS);
254
255 if (Num_object_ids[type] == 0)
256 return -1;
257
258 for (i = n + 1; i < MAX_OBJECT_IDS; i++)
259 if (Object_info[i].type == Object_info[n].type)
260 return i;
261
262 for (i = 0; i <= n; i++)
263 if (Object_info[i].type == Object_info[n].type)
264 return i;
265
266 Int3(); // shouldn't be here
267 return n;
268}
269
270// Gets previous object from n that has the same type
271int GetPrevObjectID(int n) {

Callers 5

CountLockedItemsMethod · 0.85
UpdateDialogMethod · 0.85
OnGenericDeleteMethod · 0.85
OnGenericNextMethod · 0.85
InitObjIDComboBoxMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected