Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Unless this weapon should follow standard logic...
- function RaycastWeaponBase:_soundfix_should_play_normal()
- local name_id = self:get_name_id()
- if tweak_data.weapon[name_id].sounds.fire_single == nil then
- return true
- end
- return false
- end
- -- ...don't play a sound conventionally...
- local original_fire_sound = RaycastWeaponBase._fire_sound
- function RaycastWeaponBase:_fire_sound()
- if self:_soundfix_should_play_normal() then
- original_fire_sound(self)
- end
- end
- -- ...and instead play the single fire noise here
- local original_fire = RaycastWeaponBase.fire
- function RaycastWeaponBase:fire(...)
- local result = original_fire(self, ...)
- -- TODO?: Why should this have to check for result?
- if not self:_soundfix_should_play_normal() and result then
- self:play_tweak_data_sound("fire_single", "fire")
- end
- return result
- end
Advertisement
Add Comment
Please, Sign In to add comment