Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void B_PrevBase_f (void)
- {
- const base_t *currentBase = B_GetCurrentSelectedBase();
- const base_t *prevBase;
- base_t *base;
- if (!currentBase)
- return;
- prevBase = NULL;
- base = NULL;
- while ((base = B_GetNextFounded(base)) != NULL) {
- if (base == currentBase)
- break;
- prevBase = base;
- }
- /* if it was the first base, select the last */
- if (!prevBase) {
- while ((base = B_GetNextFounded(base)) != NULL) {
- prevBase = base;
- }
- }
- if (prevBase)
- B_SelectBase(prevBase);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement