some more cleanup
This commit is contained in:
parent
f036853932
commit
53a13aac3a
|
@ -55,6 +55,8 @@ this.runtimeData = {
|
||||||
-- }}}
|
-- }}}
|
||||||
|
|
||||||
-- {{{ Functions
|
-- {{{ Functions
|
||||||
|
this.log = function(...) mwse.log("[%s] %s", this.logString, string.format(...)) end
|
||||||
|
|
||||||
this.split = function(input, sep)
|
this.split = function(input, sep)
|
||||||
if not input then return end
|
if not input then return end
|
||||||
if not sep then sep = "%s" end
|
if not sep then sep = "%s" end
|
||||||
|
@ -63,14 +65,10 @@ this.split = function(input, sep)
|
||||||
return output
|
return output
|
||||||
end
|
end
|
||||||
|
|
||||||
this.log = function(...) mwse.log("[%s] %s", this.logString, string.format(...)) end
|
|
||||||
|
|
||||||
this.vowel = function(word)
|
this.vowel = function(word)
|
||||||
local s = string.sub(word, 1, 1)
|
local s = string.sub(word, 1, 1)
|
||||||
local n = ""
|
local n = ""
|
||||||
|
|
||||||
if string.match(s, "[AOEUIaoeui]") then n = "n" end
|
if string.match(s, "[AOEUIaoeui]") then n = "n" end
|
||||||
|
|
||||||
return n
|
return n
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -120,7 +118,6 @@ this.checkModdedCell = function(cellId)
|
||||||
end
|
end
|
||||||
|
|
||||||
this.isCantonWorksCell = function(cell)
|
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()
|
local id = cell.id:lower()
|
||||||
return id:match("waistworks") or id:match("canalworks") or id:match("underworks")
|
return id:match("waistworks") or id:match("canalworks") or id:match("underworks")
|
||||||
end
|
end
|
||||||
|
|
|
@ -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",
|
"[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)
|
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
|
-- 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
|
if (config.ignored[faction:lower()] or info.playerJoined) and
|
||||||
(npcs.total >= config.minimumOccupancy or faction == "Blades") and
|
(npcs.total >= config.minimumOccupancy or faction == "Blades") and
|
||||||
|
|
|
@ -17,10 +17,8 @@ local function moveNPC(homeData)
|
||||||
-- add to in memory table
|
-- add to in memory table
|
||||||
local badWeather = checks.isBadWeatherNPC(npc)
|
local badWeather = checks.isBadWeatherNPC(npc)
|
||||||
if badWeather then
|
if badWeather then
|
||||||
-- table.insert(common.runtimeData.movedBadWeatherNPCs, homeData)
|
|
||||||
common.runtimeData.disabledBadWeatherNPCs[npc.id] = homeData
|
common.runtimeData.disabledBadWeatherNPCs[npc.id] = homeData
|
||||||
else
|
else
|
||||||
-- table.insert(common.runtimeData.movedNPCs, homeData)
|
|
||||||
common.runtimeData.movedNPCs[npc.id] = homeData
|
common.runtimeData.movedNPCs[npc.id] = homeData
|
||||||
end
|
end
|
||||||
interop.setRuntimeData(common.runtimeData)
|
interop.setRuntimeData(common.runtimeData)
|
||||||
|
@ -47,10 +45,8 @@ local function disableNPC(npc)
|
||||||
-- same thing as moveNPC, but disables instead
|
-- same thing as moveNPC, but disables instead
|
||||||
-- add to runtimeData
|
-- add to runtimeData
|
||||||
if checks.isBadWeatherNPC(npc) then
|
if checks.isBadWeatherNPC(npc) then
|
||||||
-- table.insert(common.runtimeData.disabledBadWeatherNPCs, npc)
|
|
||||||
common.runtimeData.disabledBadWeatherNPCs[npc.id] = npc
|
common.runtimeData.disabledBadWeatherNPCs[npc.id] = npc
|
||||||
else
|
else
|
||||||
-- table.insert(common.runtimeData.disabledNPCs, npc)
|
|
||||||
common.runtimeData.disabledNPCs[npc.id] = npc
|
common.runtimeData.disabledNPCs[npc.id] = npc
|
||||||
end
|
end
|
||||||
-- set NPC data
|
-- set NPC data
|
||||||
|
@ -141,10 +137,8 @@ local function checkForMovedOrDisabledNPCs(cell)
|
||||||
-- disabled NPC
|
-- disabled NPC
|
||||||
if badWeather then
|
if badWeather then
|
||||||
common.runtimeData.disabledBadWeatherNPCs[npc.id] = npc
|
common.runtimeData.disabledBadWeatherNPCs[npc.id] = npc
|
||||||
-- table.insert(common.runtimeData.disabledBadWeatherNPCs, npc)
|
|
||||||
else
|
else
|
||||||
common.runtimeData.disabledNPCs[npc.id] = npc
|
common.runtimeData.disabledNPCs[npc.id] = npc
|
||||||
-- table.insert(common.runtimeData.disabledNPCs, npc)
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
-- homed NPC
|
-- homed NPC
|
||||||
|
@ -155,10 +149,8 @@ local function checkForMovedOrDisabledNPCs(cell)
|
||||||
|
|
||||||
-- add to in memory table
|
-- add to in memory table
|
||||||
if badWeather then
|
if badWeather then
|
||||||
-- table.insert(common.runtimeData.movedBadWeatherNPCs, homeData)
|
|
||||||
common.runtimeData.disabledBadWeatherNPCs[npc.id] = homeData
|
common.runtimeData.disabledBadWeatherNPCs[npc.id] = homeData
|
||||||
else
|
else
|
||||||
-- table.insert(common.runtimeData.movedNPCs, homeData)
|
|
||||||
common.runtimeData.movedNPCs[npc.id] = homeData
|
common.runtimeData.movedNPCs[npc.id] = homeData
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue