From 36706a6cdd2cefe4d474975137cc76bb93d70168 Mon Sep 17 00:00:00 2001 From: Jisk <37682565+Jiskster@users.noreply.github.com> Date: Sat, 7 Sep 2024 17:33:48 -0500 Subject: [PATCH] check for display player when close --- src/Lua/pizzaface.lua | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/Lua/pizzaface.lua b/src/Lua/pizzaface.lua index 233c31b..adab96a 100644 --- a/src/Lua/pizzaface.lua +++ b/src/Lua/pizzaface.lua @@ -384,12 +384,14 @@ addHook("MobjThinker", function(mobj) local beingHidden = false - if R_PointToDist(mobj.x,mobj.y) <= 100*mobj.scale - or ((mobj.cameraman and mobj.cameraman.valid) and (displayplayer.awayviewmobj == mobj.cameraman)) - mobj.frame = $|CLOSE_TRANS - beingHidden = true - else - mobj.frame = $ &~CLOSE_TRANS + if displayplayer and displayplayer.valid then + if R_PointToDist(mobj.x,mobj.y) <= 100*mobj.scale + or ((mobj.cameraman and mobj.cameraman.valid) and (displayplayer.awayviewmobj == mobj.cameraman)) + mobj.frame = $|CLOSE_TRANS + beingHidden = true + else + mobj.frame = $ &~CLOSE_TRANS + end end --Set up camera point for PFViewpoint