Miscellaneous Tweaks (#1720)

changes:

Refactored footstep sounds to use less operations & only calculate for human-types.
Improved the logging detail of the lighting profiler.
Fixed some shuttle corners that weren't correctly working with parallax space.
Converted get_turf() into a compiler macro.
Solars are now dynamically lit.
Silenced warning from lighting overlays pooling themselves when updated on a space tile.
Fixed a bug where securing a girder was instant when it was supposed to have a delay.
This commit is contained in:
Lohikar
2017-02-07 10:46:39 -06:00
committed by skull132
parent ed6dbee896
commit bc441ab9d6
20 changed files with 122 additions and 77 deletions
@@ -98,3 +98,5 @@
var/equipment_see_invis // Max see invibility level granted by equipped items
var/equipment_prescription // Eye prescription granted by equipped items
var/list/equipment_overlays = list() // Extra overlays from equipped items
var/is_noisy = FALSE // if TRUE, movement should make sound.
@@ -122,3 +122,14 @@
if(shoes && (shoes.item_flags & NOSLIP) && istype(shoes, /obj/item/clothing/shoes/magboots)) //magboots + dense_object = no floating
return 1
return 0
/mob/living/carbon/human/Move()
. = ..()
if (is_noisy)
var/turf/T = get_turf(src)
if (m_intent == "run")
playsound(src, T.footstep_sound, 70, 1)
else
footstep++
if (footstep % 2)
playsound(src, T.footstep_sound, 40, 1)
@@ -129,6 +129,7 @@ This saves us from having to call add_fingerprint() any time something is put in
else if (W == shoes)
shoes = null
update_inv_shoes()
update_noise_level()
else if (W == belt)
belt = null
update_inv_belt()
@@ -265,6 +266,7 @@ This saves us from having to call add_fingerprint() any time something is put in
src.shoes = W
W.equipped(src, slot)
update_inv_shoes(redraw_mob)
update_noise_level()
if(slot_wear_suit)
src.wear_suit = W
if(wear_suit.flags_inv & HIDESHOES)
@@ -425,4 +427,18 @@ This saves us from having to call add_fingerprint() any time something is put in
W.equipped(src,slot_r_hand)
W.add_fingerprint(src)
update_inv_r_hand()
return 1
return 1
/mob/living/carbon/human/proc/update_noise_level()
is_noisy = FALSE
if (lying || !shoes || !istype(shoes, /obj/item/clothing/shoes))
return
if (shoes:silent)
return
var/turf/T = get_turf(src)
if (!istype(T) || !T.footstep_sound)
return
is_noisy = TRUE