Advertisement
Guest User

Untitled

a guest
Oct 24th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. // [RH] Select the deathmatch spawn spot farthest from everyone.
  2. static FPlayerStart *SelectFarthestDeathmatchSpot( ULONG ulPlayer, size_t selections )
  3. {
  4. fixed_t bestdistance = 0;
  5. FPlayerStart *bestspot = NULL;
  6. unsigned int i;
  7.  
  8. for (i = 0; i < selections; i++)
  9. {
  10. fixed_t distance = PlayersRangeFromSpot (&deathmatchstarts[i]);
  11.  
  12. // Did not find a spot.
  13. if ( distance == INT_MAX )
  14. continue;
  15.  
  16. if ( G_CheckSpot( ulPlayer, &deathmatchstarts[i] ) == false )
  17. continue;
  18.  
  19. if (distance > bestdistance)
  20. {
  21. bestdistance = distance;
  22. bestspot = &deathmatchstarts[i];
  23. }
  24. }
  25.  
  26. return bestspot;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement