Debug unknown message modes

Fix broadcast message mode
This commit is contained in:
Eduardo Bart 2012-07-26 19:29:04 -03:00
parent d2b85bdba8
commit 964c73a6ad
2 changed files with 12 additions and 6 deletions

View File

@ -20,7 +20,7 @@ SpeakTypes = {
[MessageModes.Say] = SpeakTypesSettings.say, [MessageModes.Say] = SpeakTypesSettings.say,
[MessageModes.Whisper] = SpeakTypesSettings.whisper, [MessageModes.Whisper] = SpeakTypesSettings.whisper,
[MessageModes.Yell] = SpeakTypesSettings.yell, [MessageModes.Yell] = SpeakTypesSettings.yell,
[MessageModes.GamemasterPrivateFrom] = SpeakTypesSettings.broadcast, [MessageModes.GamemasterBroadcast] = SpeakTypesSettings.broadcast,
[MessageModes.PrivateFrom] = SpeakTypesSettings.private, [MessageModes.PrivateFrom] = SpeakTypesSettings.private,
[MessageModes.GamemasterPrivateFrom] = SpeakTypesSettings.privateRed, [MessageModes.GamemasterPrivateFrom] = SpeakTypesSettings.privateRed,
[MessageModes.NpcTo] = SpeakTypesSettings.privatePlayerToNpc, [MessageModes.NpcTo] = SpeakTypesSettings.privatePlayerToNpc,
@ -448,10 +448,16 @@ function applyMessagePrefixies(name, level, message)
return message return message
end end
function onTalk(name, level, speaktype, message, channelId, creaturePos) function onTalk(name, level, mode, message, channelId, creaturePos)
if ignoreNpcMessages and speaktype == SpeakNpcFrom then return end if ignoreNpcMessages and mode == MessageModes.NpcFrom then return end
local defaultMessage = speaktype < 3 and true or false local defaultMessage = mode < 3 and true or false
speaktype = SpeakTypes[speaktype] speaktype = SpeakTypes[mode]
if not speaktype then
perror('unhandled onTalk message mode ' .. mode)
return
end
if speaktype.hideInConsole then return end if speaktype.hideInConsole then return end
local composedMessage = applyMessagePrefixies(name, level, message) local composedMessage = applyMessagePrefixies(name, level, message)

View File

@ -53,7 +53,7 @@ function displayMessage(mode, text)
local msgtype = MessageTypes[mode] local msgtype = MessageTypes[mode]
if not msgtype then if not msgtype then
perror('unhandled message mode ' .. mode) perror('unhandled onTextMessage message mode ' .. mode)
return return
end end