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