diff --git a/code/datums/elements/footstep.dm b/code/datums/elements/footstep.dm index 13859b2295f..d7f9fbb2d3a 100644 --- a/code/datums/elements/footstep.dm +++ b/code/datums/elements/footstep.dm @@ -40,14 +40,18 @@ footstep_sounds = GLOB.footstep if(FOOTSTEP_MOB_RUST) footstep_sounds = 'sound/effects/footstep/rustystep1.ogg' + src.volume = 90*volume if(FOOTSTEP_MOB_SLIME) footstep_sounds = 'sound/effects/footstep/slime1.ogg' + src.volume = 90*volume if(FOOTSTEP_OBJ_MACHINE) footstep_sounds = 'sound/effects/bang.ogg' + src.volume = 90*volume RegisterSignal(target, COMSIG_MOVABLE_MOVED, PROC_REF(play_simplestep_machine)) return if(FOOTSTEP_OBJ_ROBOT) footstep_sounds = 'sound/effects/tank_treads.ogg' + src.volume = 90*volume RegisterSignal(target, COMSIG_MOVABLE_MOVED, PROC_REF(play_simplestep_machine)) return // BUBBER EDIT START @@ -132,6 +136,7 @@ return if(isfile(footstep_sounds) || istext(footstep_sounds)) + /// the volume for this is defined on attach when the sound gets set footstep_sounds playsound(source.loc, footstep_sounds, volume, falloff_distance = 1, vary = sound_vary) return diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 93751e444c5..ef4509be063 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -720,7 +720,7 @@ item_flags &= ~IN_INVENTORY UnregisterSignal(src, list(SIGNAL_ADDTRAIT(TRAIT_NO_WORN_ICON), SIGNAL_REMOVETRAIT(TRAIT_NO_WORN_ICON))) SEND_SIGNAL(src, COMSIG_ITEM_DROPPED, user) - if(!silent) + if(!silent && drop_sound) playsound(src, drop_sound, DROP_SOUND_VOLUME, vary = sound_vary, ignore_walls = FALSE) user?.update_equipment_speed_mods() @@ -787,7 +787,7 @@ if(!initial) if(equip_sound && (slot_flags & slot)) playsound(src, equip_sound, EQUIP_SOUND_VOLUME, TRUE, ignore_walls = FALSE) - else if(slot & ITEM_SLOT_HANDS) + else if(slot & ITEM_SLOT_HANDS && pickup_sound) playsound(src, pickup_sound, PICKUP_SOUND_VOLUME, sound_vary, ignore_walls = FALSE) user.update_equipment_speed_mods() @@ -889,13 +889,16 @@ if(throw_drop_sound) playsound(src, throw_drop_sound, YEET_SOUND_VOLUME, ignore_walls = FALSE, vary = sound_vary) return - playsound(src, drop_sound, YEET_SOUND_VOLUME, ignore_walls = FALSE, vary = sound_vary) + else if(drop_sound) + playsound(src, drop_sound, YEET_SOUND_VOLUME, ignore_walls = FALSE, vary = sound_vary) return if(.) //it's been caught. return var/volume = get_volume_by_throwforce_and_or_w_class() + if(!volume) + return if (throwforce > 0 || HAS_TRAIT(src, TRAIT_CUSTOM_TAP_SOUND)) if (mob_throw_hit_sound) playsound(hit_atom, mob_throw_hit_sound, volume, TRUE, -1) @@ -904,7 +907,7 @@ else playsound(hit_atom, 'sound/items/weapons/genhit.ogg',volume, TRUE, -1) else - playsound(hit_atom, 'sound/items/weapons/throwtap.ogg', 1, volume, -1) + playsound(hit_atom, 'sound/items/weapons/throwtap.ogg', volume, TRUE, -1) /obj/item/throw_at(atom/target, range, speed, mob/thrower, spin=1, diagonals_first = 0, datum/callback/callback, force, gentle = FALSE, quickstart = TRUE) if(HAS_TRAIT(src, TRAIT_NODROP)) diff --git a/code/game/sound.dm b/code/game/sound.dm index c87a10011a0..57980ff7a82 100644 --- a/code/game/sound.dm +++ b/code/game/sound.dm @@ -46,12 +46,14 @@ if(islist(soundin)) CRASH("playsound(): soundin attempted to pass a list! Consider using pick()") - var/turf/turf_source = get_turf(source) - - if (!turf_source || !soundin || !vol) - return + if(!soundin) + CRASH("playsound(): no soundin passed") if(vol < SOUND_AUDIBLE_VOLUME_MIN) // never let sound go below SOUND_AUDIBLE_VOLUME_MIN or bad things will happen + CRASH("playsound(): volume below SOUND_AUDIBLE_VOLUME_MIN. [vol] < [SOUND_AUDIBLE_VOLUME_MIN]") + + var/turf/turf_source = get_turf(source) + if (!turf_source) return //allocate a channel if necessary now so its the same for everyone diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index 74246419ea5..1a3718bb046 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -184,7 +184,7 @@ return clamp((throwforce + w_class) * 5, 30, 100)// Add the item's throwforce to its weight class and multiply by 5, then clamp the value between 30 and 100 if(w_class) return clamp(w_class * 8, 20, 100) // Multiply the item's weight class by 8, then clamp the value between 20 and 100 - return 0 + return 0 // plays no sound /mob/living/proc/set_combat_mode(new_mode, silent = TRUE) diff --git a/code/modules/spells/spell.dm b/code/modules/spells/spell.dm index 221ad9b79cd..1ef4cf33aa3 100644 --- a/code/modules/spells/spell.dm +++ b/code/modules/spells/spell.dm @@ -378,7 +378,8 @@ ///even INVOCATION_NONE should go through this because the signal might change that invocation(invoker) - playsound(invoker, sound, 50, vary = TRUE) + if(sound) + playsound(invoker, sound, 50, vary = TRUE) /// The invocation that accompanies the spell, called from spell_feedback() before cast(). /datum/action/cooldown/spell/proc/invocation(mob/living/invoker)