Преглед на файлове

Support for SendMessage to send any Channel ID by number versus colors 'red' and 'yellow' hardcoded

image преди 4 години
родител
ревизия
f0699d2501
променени са 1 файла, в които са добавени 6 реда и са изтрити 0 реда
  1. 6 0
      EQ2/source/WorldServer/LuaFunctions.cpp

+ 6 - 0
EQ2/source/WorldServer/LuaFunctions.cpp

@@ -3546,10 +3546,16 @@ int EQ2Emu_lua_SendMessage(lua_State* state) {
 		Client* client = spawn->GetZone()->GetClientBySpawn(spawn);
 		if (client) {
 			if (color_str.length() > 0) {
+				// leave for backwards compat, but all future should just use the number
 				if (strncasecmp(color_str.c_str(), "red", 3) == 0)
 					color = CHANNEL_COLOR_RED;
 				else if (strncasecmp(color_str.c_str(), "yellow", 6) == 0)
 					color = CHANNEL_COLOR_YELLOW;
+				else
+				{
+					// use a number to specify the channel as per Commands/Commands.h defines
+					color = (int8)atoul(color_str.c_str());
+				}
 			}
 			client->SimpleMessage(color, message.c_str());
 		}