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

Function GetNextDoor

Descent3/door.cpp:177–195  ·  view source on GitHub ↗

Gets next door from n that has actually been alloced

Source from the content-addressed store, hash-verified

175
176// Gets next door from n that has actually been alloced
177int GetNextDoor(int n) {
178 int i;
179
180 ASSERT(n >= 0 && n < MAX_DOORS);
181
182 if (Num_doors == 0)
183 return -1;
184
185 for (i = n + 1; i < MAX_DOORS; i++)
186 if (Doors[i].used)
187 return i;
188 for (i = 0; i < n; i++)
189 if (Doors[i].used)
190 return i;
191
192 // this is the only one
193
194 return n;
195}
196
197// Gets previous door from n that has actually been alloced
198int GetPrevDoor(int n) {

Callers 5

UpdateDialogMethod · 0.85
OnNextDoorMethod · 0.85
UpdateDialogMethod · 0.85
OnDeleteDoorMethod · 0.85
OnDoorNextMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected