From 57a0b4a5eb51e855326bcb8cf185728f194922df Mon Sep 17 00:00:00 2001 From: Cadyn <35672377+cadyn@users.noreply.github.com> Date: Wed, 10 Apr 2024 22:47:16 -0700 Subject: [PATCH] minor fixes (#8209) --- .../atmoalter/portable_atmospherics.dm | 4 ++-- code/game/sound.dm | 19 +++++++++++++------ code/modules/projectiles/guns/energy.dm | 3 ++- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/code/game/machinery/atmoalter/portable_atmospherics.dm b/code/game/machinery/atmoalter/portable_atmospherics.dm index 3f61b9d181..834181308f 100644 --- a/code/game/machinery/atmoalter/portable_atmospherics.dm +++ b/code/game/machinery/atmoalter/portable_atmospherics.dm @@ -14,13 +14,13 @@ var/maximum_pressure = 90 * ONE_ATMOSPHERE /obj/machinery/portable_atmospherics/New() - ..() + //..() CHOMP Removal, moved to bottom //VOREStation Edit - Fix runtime if(air_contents) air_contents.volume = volume air_contents.temperature = T20C //VOREStation Edit End - + ..() //CHOMPEdit. Please for the love of god, do not put ..() at the top of New(), like ever return 1 /obj/machinery/portable_atmospherics/Initialize() diff --git a/code/game/sound.dm b/code/game/sound.dm index 3792f23031..4c12c8bb23 100644 --- a/code/game/sound.dm +++ b/code/game/sound.dm @@ -14,11 +14,11 @@ var/sound/S = sound(get_sfx(soundin)) var/maxdistance = (world.view + extrarange) * 2 //VOREStation Edit - 3 to 2 var/list/listeners = player_list.Copy() - if(!ignore_walls) //these sounds don't carry through walls + /*if(!ignore_walls) //these sounds don't carry through walls CHOMP Removal, ripping this logic up because it's unreliable and unnecessary. /*for(var/mob/listen in listeners) //This is beyond fucking horrible. Please do not repeatedly call hear. if(!(get_turf(listen) in hear(maxdistance,source))) listeners -= listen*/ - listeners = listeners & hearers(maxdistance,turf_source) + listeners = listeners & hearers(maxdistance,turf_source)*/ for(var/mob/M as anything in listeners) if(!M || !M.client) continue @@ -28,11 +28,18 @@ var/area/A = T.loc if((A.soundproofed || area_source.soundproofed) && (A != area_source)) continue - var/distance = get_dist(T, turf_source) + //var/distance = get_dist(T, turf_source) Save get_dist for later because it's more expensive - if(distance <= maxdistance) - if(T && T.z == turf_source.z) - M.playsound_local(turf_source, soundin, vol, vary, frequency, falloff, is_global, channel, pressure_affected, S, preference, volume_channel) + //CHOMPEdit Begin + + if(!T || T.z != turf_source.z) //^ +1 + continue + if(get_dist(T, turf_source) > maxdistance) + continue + if(!ignore_walls && !can_see(turf_source, T, length = maxdistance * 2)) + continue + + M.playsound_local(turf_source, soundin, vol, vary, frequency, falloff, is_global, channel, pressure_affected, S, preference, volume_channel) /mob/proc/playsound_local(turf/turf_source, soundin, vol as num, vary, frequency, falloff, is_global, channel = 0, pressure_affected = TRUE, sound/S, preference, volume_channel = null) if(!client || ear_deaf > 0) diff --git a/code/modules/projectiles/guns/energy.dm b/code/modules/projectiles/guns/energy.dm index 500cd71abf..8bc9ea68ab 100644 --- a/code/modules/projectiles/guns/energy.dm +++ b/code/modules/projectiles/guns/energy.dm @@ -30,7 +30,7 @@ var/random_start_ammo = FALSE //if TRUE, the weapon will spawn with randomly-determined ammo /obj/item/weapon/gun/energy/New() - ..() + //..() CHOMPEdit moved to bottom var/static/list/gun_icons = icon_states('icons/obj/gun_ch.dmi') if (icon == 'icons/obj/gun_ch.dmi' && !(icon_state in gun_icons)) icon = 'icons/obj/gun.dmi' @@ -46,6 +46,7 @@ if(random_start_ammo && cell_type) power_supply.charge = charge_cost*rand(0,power_supply.maxcharge/charge_cost) update_icon() + ..() //CHOMPEdit if you see this, it is a cry for help. Please tell people to stop putting ..() at the top of New() :( /obj/item/weapon/gun/energy/Destroy() if(self_recharge)