From bb761ae77680cdd995cdee4116a1276f91792083 Mon Sep 17 00:00:00 2001 From: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com> Date: Sat, 5 Nov 2022 20:46:25 -0700 Subject: [PATCH] Fixes parallax runtimes when your eye is not a mob (#71072) ## About The Pull Request Also properly supports passing no input into the update proc --- code/_onclick/hud/hud.dm | 2 +- code/_onclick/hud/parallax.dm | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/code/_onclick/hud/hud.dm b/code/_onclick/hud/hud.dm index 0c24316b5dc..e90e6d22333 100644 --- a/code/_onclick/hud/hud.dm +++ b/code/_onclick/hud/hud.dm @@ -173,7 +173,7 @@ GLOBAL_LIST_INIT(available_ui_styles, list( /datum/hud/proc/eye_z_changed(atom/eye) SIGNAL_HANDLER - update_parallax_pref(eye) // If your eye changes z level, so should your parallax prefs + update_parallax_pref() // If your eye changes z level, so should your parallax prefs var/turf/eye_turf = get_turf(eye) var/new_offset = GET_TURF_PLANE_OFFSET(eye_turf) if(current_plane_offset == new_offset) diff --git a/code/_onclick/hud/parallax.dm b/code/_onclick/hud/parallax.dm index 8e378f8c52f..ad8ab9ca1ab 100755 --- a/code/_onclick/hud/parallax.dm +++ b/code/_onclick/hud/parallax.dm @@ -83,11 +83,12 @@ return FALSE /datum/hud/proc/update_parallax_pref(mob/viewmob) - if(!viewmob.client) + var/mob/screen_mob = viewmob || mymob + if(!screen_mob.client) return - remove_parallax(viewmob) - create_parallax(viewmob) - update_parallax(viewmob) + remove_parallax(screen_mob) + create_parallax(screen_mob) + update_parallax(screen_mob) // This sets which way the current shuttle is moving (returns true if the shuttle has stopped moving so the caller can append their animation) /datum/hud/proc/set_parallax_movedir(new_parallax_movedir = 0, skip_windups, mob/viewmob)