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

Function GetNextShip

Descent3/ship.cpp:184–203  ·  view source on GitHub ↗

Gets next ship from n that has actually been alloced

Source from the content-addressed store, hash-verified

182
183// Gets next ship from n that has actually been alloced
184int GetNextShip(int n) {
185 int i;
186
187 if (Num_ships == 0)
188 return -1;
189
190 if ((n < 0) || (n >= MAX_SHIPS))
191 n = -1;
192
193 for (i = n + 1; i < MAX_SHIPS; i++)
194 if (Ships[i].used)
195 return i;
196 for (i = 0; i < n; i++)
197 if (Ships[i].used)
198 return i;
199
200 // this is the only one
201
202 return n;
203}
204
205// Gets previous ship from n that has actually been alloced
206int GetPrevShip(int n) {

Callers 6

OnPshipDeleteMethod · 0.85
OnPshipNextMethod · 0.85
UpdateDialogMethod · 0.85
ObjInitPlayerFunction · 0.85
ProcessTestKeysFunction · 0.85
PlayerChangeShipFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected