--Autofire Soundfix, unofficial hotfix Post-U109

--edit: 17.10.16 fixed! Sorry, uploaded an old version. Now it ACTUALLY works.

local base_fire_sound = RaycastWeaponBase . _fire_sound

function RaycastWeaponBase : _fire_sound ( )

if self : get_name_id ( ) == "saw" or self : get_name_id ( ) == "saw_secondary" or self : get_name_id ( ) == "m134" or self : get_name_id ( ) == "flamethrower_mk2" or self : get_name_id ( ) == "mg42" then

base_fire_sound ( self )

end --to delete?

end

local old_fire = RaycastWeaponBase . fire

function RaycastWeaponBase : fire ( ... )

local result = old_fire ( self , ... )

if self : get_name_id ( ) == "saw" or self : get_name_id ( ) == "saw_secondary" or self : get_name_id ( ) == "m134" or self : get_name_id ( ) == "flamethrower_mk2" or self : get_name_id ( ) == "mg42" then

return result

end

if result then

self : play_tweak_data_sound ( "fire_single" , "fire" )

end

return result

end

function RaycastWeaponBase : play_tweak_data_sound ( event , alternative_event )

local sounds = tweak_data . weapon [ self . _name_id ] . sounds

local event = sounds and ( sounds [ event ] or sounds [ alternative_event ] )

if event then

self : play_sound ( event )

end