some more cleanup

This commit is contained in:
Lilian Jónsdóttir 2020-10-05 00:47:51 -07:00
parent f036853932
commit 53a13aac3a
3 changed files with 2 additions and 16 deletions

View file

@ -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

View file

@ -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

View file

@ -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