From efc88eddb2eae89f4fbcd37a187bf1ddf8be5572 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lilian=20J=C3=B3nsd=C3=B3ttir?= Date: Thu, 6 Aug 2020 23:24:06 -0700 Subject: [PATCH] fixed interaction config option only being updated on cell change --- MWSE/mods/celediel/NPCsGoHome/common.lua | 9 +++++++++ MWSE/mods/celediel/NPCsGoHome/main.lua | 8 ++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/MWSE/mods/celediel/NPCsGoHome/common.lua b/MWSE/mods/celediel/NPCsGoHome/common.lua index 3956033..3a052ee 100644 --- a/MWSE/mods/celediel/NPCsGoHome/common.lua +++ b/MWSE/mods/celediel/NPCsGoHome/common.lua @@ -26,4 +26,13 @@ this.inspect = function(thing) this.log(inspect(thing)) end +this.vowel = function(str) + local s = string.sub(str, 1, 1) + local n = "" + + if string.match(s, "[AOEUIaoeui]") then n = "n" end + + return n +end + return this diff --git a/MWSE/mods/celediel/NPCsGoHome/main.lua b/MWSE/mods/celediel/NPCsGoHome/main.lua index 92aa031..a876f88 100644 --- a/MWSE/mods/celediel/NPCsGoHome/main.lua +++ b/MWSE/mods/celediel/NPCsGoHome/main.lua @@ -686,7 +686,7 @@ local function updatePlayerTrespass(cell) cell = cell or tes3.getPlayerCell() if checkInteriorCell(cell) and not isIgnoredCell(cell) and not isPublicHouse(cell) then - if config.disableInteraction and checkTime() then + if checkTime() then tes3.player.data.NPCsGoHome.intruding = true else tes3.player.data.NPCsGoHome.intruding = false @@ -701,7 +701,11 @@ end -- {{{ event functions local function onActivated(e) - if e.activator ~= tes3.player or e.target.object.objectType ~= tes3.objectType.npc then return end + if e.activator ~= tes3.player or + e.target.object.objectType ~= tes3.objectType.npc or + not config.disableInteraction then + return + end if tes3.player.data.NPCsGoHome.intruding and not isIgnoredNPC(e.target) then tes3.messageBox(string.format("%s: Get out before I call the guards!", e.target.object.name))