Fixed issue where hostname could be retrieved too early if it was set in server.cfg;

thereby having an incorrect hostname if %hostname% was used in the message

Also, if the hostname cvar changes at any time before a map change occurs, then %hostname% should be replaced with the new value
This commit is contained in:
Scott Ehlert
2006-04-25 07:35:02 +00:00
parent 1f44f5f481
commit f673e641f3
2 changed files with 12 additions and 9 deletions

View File

@ -84,6 +84,13 @@ public msgInit()
g_startPos = 0
g_xPos = 0.65
new hostname[64]
get_cvar_string("hostname", hostname, 63)
replace(g_scrollMsg, SCROLLMSG_SIZE-1, "%hostname%", hostname)
g_Length = strlen(g_scrollMsg)
set_task(SPEED, "showMsg", 123, "", 0, "a", g_Length + 48)
client_print(0, print_console, "%s", g_scrollMsg)
}
@ -93,10 +100,6 @@ public setMessage()
remove_task(123) /* remove current messaging */
read_argv(1, g_scrollMsg, SCROLLMSG_SIZE-1)
new hostname[64]
get_cvar_string("hostname", hostname, 63)
replace(g_scrollMsg, SCROLLMSG_SIZE-1, "%hostname%", hostname)
g_Length = strlen(g_scrollMsg)
new mytime[32]