From dafb4af875a633598b94369cdd4ed4843e6db0de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lilian=20J=C3=B3nsd=C3=B3ttir?= Date: Sat, 22 Aug 2020 13:55:59 -0700 Subject: [PATCH] preparing for better picking of public house type --- MWSE/mods/celediel/NPCsGoHome/main.lua | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/MWSE/mods/celediel/NPCsGoHome/main.lua b/MWSE/mods/celediel/NPCsGoHome/main.lua index 79228e3..17699f0 100644 --- a/MWSE/mods/celediel/NPCsGoHome/main.lua +++ b/MWSE/mods/celediel/NPCsGoHome/main.lua @@ -161,12 +161,12 @@ local function checkManor(cellName, npcName) end -- todo: pick this better -local function pickPublicHouseType(cellName) - if cellName:match("Guild") then +local function pickPublicHouseType(cell) + if cell.id:match("Guild") then return publicHouseTypes.guildhalls - elseif cellName:match("Temple") then + elseif cell.id:match("Temple") then return publicHouseTypes.temples - -- elseif cellName:match("House") then + -- elseif cell.id:match("House") then -- return publicHouseTypes.houses else return publicHouseTypes.inns @@ -281,7 +281,7 @@ local function createHomedNPCTableEntry(npc, home, startingPlace, isHome, positi end local function createPublicHouseTableEntry(publicCell, proprietor, city, name) - local typeOfPub = pickPublicHouseType(publicCell.name) + local typeOfPub = pickPublicHouseType(publicCell) local worth = 0 @@ -467,7 +467,7 @@ local function isPublicHouse(cell) -- only interior cells are public "houses" if not isInteriorCell(cell) then return false end - local typeOfPub = pickPublicHouseType(cell.name) + local typeOfPub = pickPublicHouseType(cell) local city, publicHouseName if cell.name and string.match(cell.name, ",") then @@ -620,7 +620,7 @@ local function checkEnteredNPCHome(cell) end local function checkEnteredPublicHouse(cell, city) - local typeOfPub = pickPublicHouseType(cell.name) + local typeOfPub = pickPublicHouseType(cell) local publicHouse = publicHouses[city] and (publicHouses[city][typeOfPub] and publicHouses[city][typeOfPub][cell.name])