From b11572ed6af0233205e6095490de16efd7a41907 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lilian=20J=C3=B3nsd=C3=B3ttir?= Date: Sun, 4 Oct 2020 21:37:05 -0700 Subject: [PATCH] don't actually need the reference --- MWSE/mods/celediel/NPCsGoHome/functions/checks.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MWSE/mods/celediel/NPCsGoHome/functions/checks.lua b/MWSE/mods/celediel/NPCsGoHome/functions/checks.lua index a896987..459c7ca 100644 --- a/MWSE/mods/celediel/NPCsGoHome/functions/checks.lua +++ b/MWSE/mods/celediel/NPCsGoHome/functions/checks.lua @@ -216,7 +216,7 @@ this.isPublicHouse = function(cell) if faction then local id = faction.id:lower() if not npcs.factions[id] then - npcs.factions[id] = {ref = faction, total = 0, percentage = 0} + npcs.factions[id] = {playerJoined = faction.playerJoined, total = 0, percentage = 0} end if not npcs.factions[id].master or npcs.factions[id].master.object.factionIndex < @@ -245,13 +245,13 @@ this.isPublicHouse = function(cell) info.percentage = (info.total / npcs.total) * 100 log(common.logLevels.large, "[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.ref.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 - if (config.ignored[faction:lower()] or info.ref.playerJoined) and + if (config.ignored[faction:lower()] or info.playerJoined) and (npcs.total >= config.minimumOccupancy or faction == "Blades") and (info.percentage >= config.factionIgnorePercentage) then log(common.logLevels.medium, "[CHECKS] %s is %s%% faction %s, marking public.", cell.name, info.percentage,