From f06796c27593c9af5c8c729579f610835d427c8b Mon Sep 17 00:00:00 2001 From: Pavol Marko Date: Tue, 31 Aug 2004 13:20:29 +0000 Subject: [PATCH] Changed so that a MOTD will also display when there is no ServerName message (as proposed by karlos on the forums). --- amxmodx/util.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/amxmodx/util.cpp b/amxmodx/util.cpp index 8672ef57..d0f4c895 100755 --- a/amxmodx/util.cpp +++ b/amxmodx/util.cpp @@ -79,12 +79,15 @@ void UTIL_ShowMenu( edict_t* pEdict, int slots, int time, char *menu, int mlen ) /* warning - don't pass here const string */ void UTIL_ShowMOTD( edict_t *client , char *motd, int mlen, const char *name) { - if (!gmsgServerName) + if (!gmsgMOTD) return; // :TODO: Maybe output a warning log? - MESSAGE_BEGIN( MSG_ONE , gmsgServerName, NULL, client ); - WRITE_STRING(name); - MESSAGE_END(); + if (gmsgServerName) + { + MESSAGE_BEGIN( MSG_ONE , gmsgServerName, NULL, client ); + WRITE_STRING(name); + MESSAGE_END(); + } char *n = motd; char c = 0; @@ -104,9 +107,12 @@ void UTIL_ShowMOTD( edict_t *client , char *motd, int mlen, const char *name) motd = n; } - MESSAGE_BEGIN( MSG_ONE , gmsgServerName, NULL, client ); - WRITE_STRING( hostname->string ); - MESSAGE_END(); + if (gmsgServerName) + { + MESSAGE_BEGIN( MSG_ONE , gmsgServerName, NULL, client ); + WRITE_STRING( hostname->string ); + MESSAGE_END(); + } } void UTIL_IntToString(int value, char *output)