From 968fb3b7afebaf700668f853773df8a146df1468 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lilian=20J=C3=B3nsd=C3=B3ttir?= Date: Sat, 22 Aug 2020 13:55:33 -0700 Subject: [PATCH] some npcs don't have heads??? --- MWSE/mods/celediel/NPCsGoHome/main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MWSE/mods/celediel/NPCsGoHome/main.lua b/MWSE/mods/celediel/NPCsGoHome/main.lua index 341e5a5..79228e3 100644 --- a/MWSE/mods/celediel/NPCsGoHome/main.lua +++ b/MWSE/mods/celediel/NPCsGoHome/main.lua @@ -419,7 +419,7 @@ local function isIgnoredNPC(npc) else -- local fight = getFightFromSpawnedReference(obj.id) -- ! calling this hundreds of times is bad for performance lol -- if (fight or 0) > 70 then isHostile = true end - isVampire = obj.head.vampiric and true or false -- don't set a reference ... is bool even a reference type?? + isVampire = obj.head and (obj.head.vampiric and true or false) or false if obj.id:match("[Dd]ead") or obj.name:match("[Dd]ead") then isDead = true end end