Changed so that a MOTD will also display when there is no ServerName message (as proposed by karlos on the forums).

This commit is contained in:
Pavol Marko 2004-08-31 13:20:29 +00:00
parent e15c151167
commit f06796c275

View File

@ -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 */ /* warning - don't pass here const string */
void UTIL_ShowMOTD( edict_t *client , char *motd, int mlen, const char *name) void UTIL_ShowMOTD( edict_t *client , char *motd, int mlen, const char *name)
{ {
if (!gmsgServerName) if (!gmsgMOTD)
return; // :TODO: Maybe output a warning log? return; // :TODO: Maybe output a warning log?
MESSAGE_BEGIN( MSG_ONE , gmsgServerName, NULL, client ); if (gmsgServerName)
WRITE_STRING(name); {
MESSAGE_END(); MESSAGE_BEGIN( MSG_ONE , gmsgServerName, NULL, client );
WRITE_STRING(name);
MESSAGE_END();
}
char *n = motd; char *n = motd;
char c = 0; char c = 0;
@ -104,9 +107,12 @@ void UTIL_ShowMOTD( edict_t *client , char *motd, int mlen, const char *name)
motd = n; motd = n;
} }
MESSAGE_BEGIN( MSG_ONE , gmsgServerName, NULL, client ); if (gmsgServerName)
WRITE_STRING( hostname->string ); {
MESSAGE_END(); MESSAGE_BEGIN( MSG_ONE , gmsgServerName, NULL, client );
WRITE_STRING( hostname->string );
MESSAGE_END();
}
} }
void UTIL_IntToString(int value, char *output) void UTIL_IntToString(int value, char *output)