Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. static void B_PrevBase_f (void)
  2. {
  3. const base_t *currentBase = B_GetCurrentSelectedBase();
  4. const base_t *prevBase;
  5. base_t *base;
  6.  
  7. if (!currentBase)
  8. return;
  9.  
  10. prevBase = NULL;
  11. base = NULL;
  12. while ((base = B_GetNextFounded(base)) != NULL) {
  13. if (base == currentBase)
  14. break;
  15. prevBase = base;
  16. }
  17. /* if it was the first base, select the last */
  18. if (!prevBase) {
  19. while ((base = B_GetNextFounded(base)) != NULL) {
  20. prevBase = base;
  21. }
  22. }
  23.  
  24. if (prevBase)
  25. B_SelectBase(prevBase);
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement