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

Function StopWeapon

Descent3/WeaponFire.cpp:2795–2817  ·  view source on GitHub ↗

Stops weapon sound & visual effects

Source from the content-addressed store, hash-verified

2793
2794// Stops weapon sound & visual effects
2795void StopWeapon(object *obj, player_weapon *pw, otype_wb_info *wb) {
2796 // Stop any on/off weapons
2797 if (obj->weapon_fire_flags & WFF_ON_OFF)
2798 StopOnOffWeapon(obj);
2799
2800 // Stop spray weapons
2801 if (wb->flags & WBF_SPRAY)
2802 obj->weapon_fire_flags &= ~WFF_SPRAY;
2803
2804 // Stop firing sound if one playing
2805 if (pw && pw->sound_handle != -1) {
2806 Sound_system.StopSoundImmediate(pw->sound_handle);
2807 pw->sound_handle = -1;
2808 }
2809
2810 // Clear firing time
2811 if (pw) {
2812 pw->firing_time = 0.0;
2813 }
2814 if (Demo_flags == DF_RECORDING) {
2815 DemoWriteObjWeapFireFlagChanged(OBJNUM(obj));
2816 }
2817}
2818
2819// Does weapon battery stuff for the permissable network architecture
2820void DoPermissableWeaponMask(int weapon_battery_index) {

Callers 1

FireWeaponFromPlayerFunction · 0.85

Calls 3

StopOnOffWeaponFunction · 0.85
StopSoundImmediateMethod · 0.80

Tested by

no test coverage detected