From 09139332860d6aca33a456620763d2973cc543f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lilian=20J=C3=B3nsd=C3=B3ttir?= Date: Mon, 14 Sep 2020 21:57:45 -0700 Subject: [PATCH] don't disable NPCs in bad weather in wilderness cells --- MWSE/mods/celediel/NPCsGoHome/functions/processors.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MWSE/mods/celediel/NPCsGoHome/functions/processors.lua b/MWSE/mods/celediel/NPCsGoHome/functions/processors.lua index ee961a9..8db1442 100644 --- a/MWSE/mods/celediel/NPCsGoHome/functions/processors.lua +++ b/MWSE/mods/celediel/NPCsGoHome/functions/processors.lua @@ -117,15 +117,15 @@ this.putNPCsBack = function() interop.setRuntimeData(common.runtimeData) end +-- todo: this needs to be rewritten this.processNPCs = function(cell) local night = checks.isNight() - local badWeather = checks.isInclementWeather() + local badWeather = cell.name and checks.isInclementWeather() or false -- ignore weather in "Region" cells log(common.logLevels.small, "Looking for NPCs to process in cell:%s", cell.id) -- iterate NPCs in the cell, move them to their homes, and keep track of moved NPCs so we can move them back later for npc in cell:iterateReferences(tes3.objectType.npc) do - -- for npc, _ in pairs(cellsInMemory[cell].npcs) do if not checks.isIgnoredNPC(npc) then -- find NPC homes local npcHome = config.moveNPCs and housing.pickHomeForNPC(cell, npc) or nil @@ -157,7 +157,7 @@ this.processNPCs = function(cell) -- npc:enable() mwscript.enable({reference = npc}) -- tes3.setEnabled({reference = npc, enabled = true}) - common.runtimeData.disabledNPCs[npc.id] = false + common.runtimeData.disabledNPCs[npc.id] = nil end end end