Jelajahi Sumber

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

image 4 tahun lalu
induk
melakukan
f0699d2501
1 mengubah file dengan 6 tambahan dan 0 penghapusan
  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());
 		}