MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / MultiEnoughAmmoToFire

Function MultiEnoughAmmoToFire

Descent3/multi.cpp:3311–3319  ·  view source on GitHub ↗

Returns true if there is enough ammo to allow this player to fire, else false

Source from the content-addressed store, hash-verified

3309
3310// Returns true if there is enough ammo to allow this player to fire, else false
3311bool MultiEnoughAmmoToFire(int slot, int wb_index) {
3312 ship *ship = &Ships[Players[slot].ship_index];
3313 otype_wb_info *wb = &ship->static_wb[wb_index];
3314
3315 if (wb->ammo_usage > 0 && Players[slot].weapon_ammo[wb_index] <= 0)
3316 return false;
3317
3318 return true;
3319}
3320
3321void MultiSubtractAmmoToFire(int slot, int wb_index) {
3322 ship *ship = &Ships[Players[slot].ship_index];

Callers 2

MultiDoFirePlayerWBFunction · 0.85
MultiDoRequestToFireFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected