Catch Noise Fix (#11636)

This commit is contained in:
Geeves
2021-04-15 14:31:18 +02:00
committed by GitHub
parent e5a7ddc5a0
commit 25491fec91
3 changed files with 19 additions and 13 deletions
+11 -12
View File
@@ -305,25 +305,24 @@
return 0
/obj/item/throw_impact(atom/hit_atom)
..()
if(isliving(hit_atom)) //Living mobs handle hit sounds differently.
var/mob/living/L = hit_atom
if(L.in_throw_mode)
playsound(hit_atom, pickup_sound, PICKUP_SOUND_VOLUME, TRUE)
return
var/volume = get_volume_by_throwforce_and_or_w_class()
if(throwforce > 0)
if(mob_throw_hit_sound)
playsound(hit_atom, mob_throw_hit_sound, volume, TRUE, -1)
else if(hitsound)
playsound(hit_atom, hitsound, volume, TRUE, -1)
else
playsound(hit_atom, 'sound/weapons/genhit.ogg', volume, TRUE, -1)
else
playsound(hit_atom, 'sound/weapons/throwtap.ogg', 1, volume, -1)
var/volume = get_volume_by_throwforce_and_or_w_class()
if(throwforce > 0)
if(mob_throw_hit_sound)
playsound(hit_atom, mob_throw_hit_sound, volume, TRUE, -1)
else if(hitsound)
playsound(hit_atom, hitsound, volume, TRUE, -1)
else
playsound(hit_atom, 'sound/weapons/genhit.ogg', volume, TRUE, -1)
else
playsound(hit_atom, 'sound/weapons/throwtap.ogg', 1, volume, -1)
else
playsound(src, drop_sound, THROW_SOUND_VOLUME)
return ..()
//Apparently called whenever an item is dropped on the floor, thrown, or placed into a container.
//It is called after loc is set, so if placed in a container its loc will be that container.