diff --git a/src/LuaEngine/GlobalMethods.h b/src/LuaEngine/GlobalMethods.h index 4ed8ab2..3dc99be 100644 --- a/src/LuaEngine/GlobalMethods.h +++ b/src/LuaEngine/GlobalMethods.h @@ -692,7 +692,7 @@ namespace LuaGlobalFunctions * PLAYER_EVENT_ON_WHISPER = 19, // (event, player, msg, Type, lang, receiver) - Can return false, newMessage * PLAYER_EVENT_ON_GROUP_CHAT = 20, // (event, player, msg, Type, lang, group) - Can return false, newMessage * PLAYER_EVENT_ON_GUILD_CHAT = 21, // (event, player, msg, Type, lang, guild) - Can return false, newMessage - * PLAYER_EVENT_ON_CHANNEL_CHAT = 22, // (event, player, msg, Type, lang, channel) - Can return false, newMessage + * PLAYER_EVENT_ON_CHANNEL_CHAT = 22, // (event, player, msg, Type, lang, channel) - channel is negative for custom channels. Can return false, newMessage * PLAYER_EVENT_ON_EMOTE = 23, // (event, player, emote) - Not triggered on any known emote * PLAYER_EVENT_ON_TEXT_EMOTE = 24, // (event, player, textEmote, emoteNum, guid) * PLAYER_EVENT_ON_SAVE = 25, // (event, player) diff --git a/src/LuaEngine/Hooks.h b/src/LuaEngine/Hooks.h index 75b099c..677e5c8 100644 --- a/src/LuaEngine/Hooks.h +++ b/src/LuaEngine/Hooks.h @@ -181,7 +181,7 @@ namespace Hooks PLAYER_EVENT_ON_WHISPER = 19, // (event, player, msg, Type, lang, receiver) - Can return false, newMessage PLAYER_EVENT_ON_GROUP_CHAT = 20, // (event, player, msg, Type, lang, group) - Can return false, newMessage PLAYER_EVENT_ON_GUILD_CHAT = 21, // (event, player, msg, Type, lang, guild) - Can return false, newMessage - PLAYER_EVENT_ON_CHANNEL_CHAT = 22, // (event, player, msg, Type, lang, channel) - Can return false, newMessage + PLAYER_EVENT_ON_CHANNEL_CHAT = 22, // (event, player, msg, Type, lang, channel) - channel is negative for custom channels. Can return false, newMessage PLAYER_EVENT_ON_EMOTE = 23, // (event, player, emote) - Not triggered on any known emote PLAYER_EVENT_ON_TEXT_EMOTE = 24, // (event, player, textEmote, emoteNum, guid) PLAYER_EVENT_ON_SAVE = 25, // (event, player) diff --git a/src/LuaEngine/PlayerHooks.cpp b/src/LuaEngine/PlayerHooks.cpp index 682d05d..fb4ba71 100644 --- a/src/LuaEngine/PlayerHooks.cpp +++ b/src/LuaEngine/PlayerHooks.cpp @@ -509,7 +509,7 @@ bool Eluna::OnChat(Player* pPlayer, uint32 type, uint32 lang, std::string& msg, Push(msg); Push(type); Push(lang); - Push(pChannel->GetChannelId()); + Push(pChannel->IsConstant() ? static_cast(pChannel->GetChannelId()) : -static_cast(pChannel->GetChannelDBId())); int n = SetupStack(PlayerEventBindings, key, 5); while (n > 0)