Advertisement
Guest User

ammocount

a guest
Feb 14th, 2016
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.46 KB | None | 0 0
  1. // Little bondage play here
  2. void W_BoundAmmo(entity who)
  3. {
  4.     float i;
  5.  
  6.     for(i = 0; i < 11; i++)
  7.         who.ammo[i] = bound(0, who.ammo[i], MAX_AMMO[i]);
  8. };
  9.  
  10. // Alternating Current
  11. void W_SetCurrentAmmo(entity who)
  12. {
  13.     float d, c;
  14.  
  15.     d = who.ready_weapon; c = -1;
  16.     do {c++;} while((d /= 2) >= 1);
  17.     W_BoundAmmo(who);
  18.     who.currentammo = who.ammo[c];
  19. };
  20. // alternatively in batcave...
  21. //do { /*nothing*/ } while( /*others do all the work*/ (c++, d /= 2) >= 1);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement