From 53a13aac3abb05cfe6be5d0f66748f362b03a20d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lilian=20J=C3=B3nsd=C3=B3ttir?= Date: Mon, 5 Oct 2020 00:47:51 -0700 Subject: [PATCH] some more cleanup --- MWSE/mods/celediel/NPCsGoHome/common.lua | 7 ++----- MWSE/mods/celediel/NPCsGoHome/functions/checks.lua | 3 --- MWSE/mods/celediel/NPCsGoHome/functions/processors.lua | 8 -------- 3 files changed, 2 insertions(+), 16 deletions(-) diff --git a/MWSE/mods/celediel/NPCsGoHome/common.lua b/MWSE/mods/celediel/NPCsGoHome/common.lua index e42af3a..c182d99 100644 --- a/MWSE/mods/celediel/NPCsGoHome/common.lua +++ b/MWSE/mods/celediel/NPCsGoHome/common.lua @@ -55,6 +55,8 @@ this.runtimeData = { -- }}} -- {{{ Functions +this.log = function(...) mwse.log("[%s] %s", this.logString, string.format(...)) end + this.split = function(input, sep) if not input then return end if not sep then sep = "%s" end @@ -63,14 +65,10 @@ this.split = function(input, sep) return output end -this.log = function(...) mwse.log("[%s] %s", this.logString, string.format(...)) end - this.vowel = function(word) local s = string.sub(word, 1, 1) local n = "" - if string.match(s, "[AOEUIaoeui]") then n = "n" end - return n end @@ -120,7 +118,6 @@ this.checkModdedCell = function(cellId) end this.isCantonWorksCell = function(cell) - -- for _, str in pairs(waistworks) do if cell.id:match(str) then return true end end local id = cell.id:lower() return id:match("waistworks") or id:match("canalworks") or id:match("underworks") end diff --git a/MWSE/mods/celediel/NPCsGoHome/functions/checks.lua b/MWSE/mods/celediel/NPCsGoHome/functions/checks.lua index aca8eb3..b2abb63 100644 --- a/MWSE/mods/celediel/NPCsGoHome/functions/checks.lua +++ b/MWSE/mods/celediel/NPCsGoHome/functions/checks.lua @@ -247,9 +247,6 @@ this.isPublicHouse = function(cell) "[CHECKS] No NPCs of ignored class in %s, checking faction %s (ignored: %s, player joined: %s) with %s (%s%%) vs total %s", cell.name, faction, config.ignored[faction:lower()], info.playerJoined, info.total, info.percentage, npcs.total) - -- log(common.logLevels.large, "[CHECKS] ignored or joined:%s, occupants or blades:%s, faction percent:%s", (config.ignored[faction.id:lower()] or faction.playerJoined), - -- (npcs.total >= config.minimumOccupancy or faction == "Blades"), (info.percentage >= config.factionIgnorePercentage)) - -- less than configured amount of NPCs can't be a public house unless it's a Blades house if (config.ignored[faction:lower()] or info.playerJoined) and (npcs.total >= config.minimumOccupancy or faction == "Blades") and diff --git a/MWSE/mods/celediel/NPCsGoHome/functions/processors.lua b/MWSE/mods/celediel/NPCsGoHome/functions/processors.lua index 0616f22..ec99fde 100644 --- a/MWSE/mods/celediel/NPCsGoHome/functions/processors.lua +++ b/MWSE/mods/celediel/NPCsGoHome/functions/processors.lua @@ -17,10 +17,8 @@ local function moveNPC(homeData) -- add to in memory table local badWeather = checks.isBadWeatherNPC(npc) if badWeather then - -- table.insert(common.runtimeData.movedBadWeatherNPCs, homeData) common.runtimeData.disabledBadWeatherNPCs[npc.id] = homeData else - -- table.insert(common.runtimeData.movedNPCs, homeData) common.runtimeData.movedNPCs[npc.id] = homeData end interop.setRuntimeData(common.runtimeData) @@ -47,10 +45,8 @@ local function disableNPC(npc) -- same thing as moveNPC, but disables instead -- add to runtimeData if checks.isBadWeatherNPC(npc) then - -- table.insert(common.runtimeData.disabledBadWeatherNPCs, npc) common.runtimeData.disabledBadWeatherNPCs[npc.id] = npc else - -- table.insert(common.runtimeData.disabledNPCs, npc) common.runtimeData.disabledNPCs[npc.id] = npc end -- set NPC data @@ -141,10 +137,8 @@ local function checkForMovedOrDisabledNPCs(cell) -- disabled NPC if badWeather then common.runtimeData.disabledBadWeatherNPCs[npc.id] = npc - -- table.insert(common.runtimeData.disabledBadWeatherNPCs, npc) else common.runtimeData.disabledNPCs[npc.id] = npc - -- table.insert(common.runtimeData.disabledNPCs, npc) end else -- homed NPC @@ -155,10 +149,8 @@ local function checkForMovedOrDisabledNPCs(cell) -- add to in memory table if badWeather then - -- table.insert(common.runtimeData.movedBadWeatherNPCs, homeData) common.runtimeData.disabledBadWeatherNPCs[npc.id] = homeData else - -- table.insert(common.runtimeData.movedNPCs, homeData) common.runtimeData.movedNPCs[npc.id] = homeData end end