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
This commit is contained in:
LemonInTheDark
2022-11-05 20:46:25 -07:00
committed by GitHub
parent 9dafa8f56e
commit bb761ae776
2 changed files with 6 additions and 5 deletions
+1 -1
View File
@@ -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)
+5 -4
View File
@@ -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)