Fixes another case of broken huds on z level work (Also a runtime for ghosts) (#73520)

## About The Pull Request

[Fixes another case of broken huds on z level
work](https://github.com/tgstation/tgstation/commit/eed4336c715769f26c4fac844cc5b302014e5ab8)

This is I think new, but returning inside these loops is stupid and
breaks shit bad.

[Fixes a runtime in nightvision
checking](https://github.com/tgstation/tgstation/commit/c183fef185b66e65ae059a958a68881af7db1b25)

That list defaults to null, it can be null, be nice to it 📰

## Why It's Good For The Game

Huds are more stable, less runtimes

## Changelog
🆑
fix: Moving up and down z levels will break hud stuff slightly less
often
/🆑
This commit is contained in:
LemonInTheDark
2023-02-19 12:59:10 -08:00
committed by GitHub
parent 968a937bd3
commit dde3477830
2 changed files with 5 additions and 3 deletions
+3 -1
View File
@@ -1181,7 +1181,9 @@
**/
/mob/proc/has_nightvision()
// Somewhat conservative, basically is your lighting plane bright enough that you the user can see stuff
var/light_offset = (lighting_color_cutoffs[1] + lighting_color_cutoffs[2] + lighting_color_cutoffs[3]) / 3 + lighting_cutoff
var/light_offset = lighting_cutoff
if(length(lighting_color_cutoffs) == 3)
light_offset += (lighting_color_cutoffs[1] + lighting_color_cutoffs[2] + lighting_color_cutoffs[3]) / 3
return light_offset >= LIGHTING_NIGHTVISION_THRESHOLD
/// This mob is abile to read books