Gets next path from n that has actually been alloced
| 307 | |
| 308 | // Gets next path from n that has actually been alloced |
| 309 | int GetNextPath(int n) { |
| 310 | int i; |
| 311 | |
| 312 | ASSERT(n >= 0 && n < MAX_GAME_PATHS); |
| 313 | |
| 314 | if (Num_game_paths == 0) |
| 315 | return -1; |
| 316 | |
| 317 | for (i = n + 1; i < MAX_GAME_PATHS; i++) |
| 318 | if (GamePaths[i].used) |
| 319 | return i; |
| 320 | for (i = 0; i < n; i++) |
| 321 | if (GamePaths[i].used) |
| 322 | return i; |
| 323 | |
| 324 | // this is the only one |
| 325 | |
| 326 | return n; |
| 327 | } |
| 328 | |
| 329 | // Gets previous path from n that has actually been alloced |
| 330 | int GetPrevPath(int n) { |
no outgoing calls
no test coverage detected