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:
@ -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]
|
||||
|
Reference in New Issue
Block a user