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

Function DoPermissableWeaponMask

Descent3/WeaponFire.cpp:2820–2834  ·  view source on GitHub ↗

Does weapon battery stuff for the permissable network architecture

Source from the content-addressed store, hash-verified

2818
2819// Does weapon battery stuff for the permissable network architecture
2820void DoPermissableWeaponMask(int weapon_battery_index) {
2821 player *player = &Players[Player_num];
2822 object *objp = &Objects[player->objnum];
2823 ship *ship = &Ships[player->ship_index];
2824 otype_wb_info *wb = &ship->static_wb[weapon_battery_index];
2825 dynamic_wb_info *p_dwb = &objp->dynamic_wb[weapon_battery_index];
2826
2827 player->last_fire_weapon_time = Gametime;
2828
2829 p_dwb->cur_firing_mask++;
2830 p_dwb->last_fire_time = Gametime;
2831
2832 if (p_dwb->cur_firing_mask >= wb->num_masks)
2833 p_dwb->cur_firing_mask = 0;
2834}
2835
2836// Fires a weapon from our player. Won't fire if ammo/energy requirements aren't met.
2837// Parameters: weapon_type - either PW_PRIMARY or PW_SECONDARY

Callers 2

FireWeaponFromPlayerFunction · 0.85
FireFlareFromPlayerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected