From 9343bcfaceff0692c6567929d3bab8f9ae1fe2d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lilian=20J=C3=B3nsd=C3=B3ttir?= Date: Sun, 16 Aug 2020 15:34:42 -0700 Subject: [PATCH] this is ugly but it works, I'll clean it up later --- MWSE/mods/celediel/NPCsGoHome/main.lua | 38 ++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/MWSE/mods/celediel/NPCsGoHome/main.lua b/MWSE/mods/celediel/NPCsGoHome/main.lua index 87201d2..2751343 100644 --- a/MWSE/mods/celediel/NPCsGoHome/main.lua +++ b/MWSE/mods/celediel/NPCsGoHome/main.lua @@ -496,13 +496,39 @@ local function isIgnoredDoor(door, homeCellId) end end - log(common.logLevels.large, "%s is %s, %s is %s (%sin a city, is %spublic)", door.destination.cell.id, - config.ignored[door.destination.cell.id] and "ignored" or "not ignored", door.destination.cell.sourceMod, - config.ignored[door.destination.cell.sourceMod] and "ignored" or "not ignored", inCity and "" or "not ", - leadsToPublicCell and "" or "not ") + log(common.logLevels.large, "%s is %s, %s is %s (%sin a city, is %spublic, %soccupied)", -- + door.destination.cell.id, config.ignored[door.destination.cell.id] and "ignored" or "not ignored", -- destination is ignored + door.destination.cell.sourceMod, config.ignored[door.destination.cell.sourceMod] and "ignored" or "not ignored", -- destination mod is ignored + inCity and "" or "not ", leadsToPublicCell and "" or "not ", hasOccupants and "" or "un") -- in a city, is public, is ocupado - return config.ignored[door.destination.cell.id] or config.ignored[door.destination.cell.sourceMod] or not inCity or - leadsToPublicCell or not hasOccupants + -- todo: clean this up + -- local shit = config.ignored[door.destination.cell.id] or config.ignored[door.destination.cell.sourceMod] or not inCity or leadsToPublicCell or not hasOccupants + -- log(common.logLevels.large, "shit: %s", shit) + -- return shit + if config.ignored[door.destination.cell.id] then + log(common.logLevels.large, "ignored cell id: %s", door.destination.cell.id) + return true + + elseif config.ignored[door.destination.cell.sourceMod] then + log(common.logLevels.large, "ignored cell mod: %s", door.destination.cell.sourceMod) + return true + + elseif not inCity then + log(common.logLevels.large, "%s not in city", door.destination.cell.id) + return true + + elseif leadsToPublicCell then + log(common.logLevels.large, "%s is public", door.destination.cell.id) + return true + + elseif not hasOccupants then + log(common.logLevels.large, "%s is unoccupied", door.destination.cell.id) + return true + + -- otherwise + else + return false + end end local function isIgnoredCell(cell)