Fix NPC chat when ignoring private messages.

This commit is contained in:
BenDol 2016-01-22 16:15:35 +13:00
parent 408b3c5125
commit f024e30753
1 changed files with 5 additions and 3 deletions

View File

@ -992,7 +992,9 @@ function onTalk(name, level, mode, message, channelId, creaturePos)
return
end
if ignoreNpcMessages and mode == MessageModes.NpcFrom then return end
local isNpcMode = (mode == MessageModes.NpcFromStartBlock or mode == MessageModes.NpcFrom)
if ignoreNpcMessages and isNpcMode then return end
speaktype = SpeakTypes[mode]
@ -1008,7 +1010,7 @@ function onTalk(name, level, mode, message, channelId, creaturePos)
if mode == MessageModes.Yell and isIgnoringYelling() then
return
elseif speaktype.private and isIgnoringPrivate() and mode ~= MessageModes.NpcFrom then
elseif speaktype.private and isIgnoringPrivate() and not isNpcMode then
return
elseif isIgnored(name) then
return
@ -1026,7 +1028,7 @@ function onTalk(name, level, mode, message, channelId, creaturePos)
local staticText = StaticText.create()
-- Remove curly braces from screen message
local staticMessage = message
if mode == MessageModes.NpcFrom or mode == MessageModes.NpcFromStartBlock then
if isNpcMode then
local highlightData = getHighlightedText(staticMessage)
if #highlightData > 0 then
for i = 1, #highlightData / 3 do