From cff3ab867a3f61159cd8d985c1ba00d6da7e0981 Mon Sep 17 00:00:00 2001 From: Freeman-AM Date: Sat, 11 Oct 2014 16:00:11 +0200 Subject: [PATCH] Nextmap: replace len hardcoded content by charsmax and sizeof --- plugins/ns/nextmap.sma | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/plugins/ns/nextmap.sma b/plugins/ns/nextmap.sma index 4bbb810b..854f0987 100755 --- a/plugins/ns/nextmap.sma +++ b/plugins/ns/nextmap.sma @@ -74,11 +74,11 @@ public server_changelevel() { // Check if the cvar "amx_nextmap" has changed since the map loaded as it overrides the min/max settings. new szCvarNextMap[32] - get_cvar_string("amx_nextmap", szCvarNextMap, 31) + get_cvar_string("amx_nextmap", szCvarNextMap, charsmax(szCvarNextMap)) if ( !equal(szCvarNextMap, g_mapCycle[g_nextPos][NAME]) ) { if (ValidMap(szCvarNextMap)) { if (g_changeMapDelay) - set_task(INFO_READ_TIME, "changeMap", 0, szCvarNextMap, 32) + set_task(INFO_READ_TIME, "changeMap", 0, szCvarNextMap, sizeof(szCvarNextMap)) else changeMap(szCvarNextMap) return BLOCK_ONCE @@ -89,7 +89,7 @@ public server_changelevel() { getNextValidMap(szNextMap) if (ValidMap(szNextMap)) { if (g_changeMapDelay) - set_task(INFO_READ_TIME, "changeMap", 0, szNextMap, 32) + set_task(INFO_READ_TIME, "changeMap", 0, szNextMap, sizeof(szNextMap)) else changeMap(szNextMap) } else @@ -134,7 +134,7 @@ public getNextValidMap(szNextMap[]) { (g_mapCycle[startPos][MIN] <= g_numPlayers) ? "many" : "few", g_mapCycle[startPos][NAME], g_mapCycle[g_nextPos][NAME]) new szPos[8] - num_to_str(g_nextPos, szPos, 7) + num_to_str(g_nextPos, szPos, charsmax(szPos)) set_localinfo("amx_nextmap_pos", szPos) set_cvar_string("amx_nextmap", g_mapCycle[g_nextPos][NAME]) g_changeMapDelay = true @@ -143,7 +143,7 @@ public getNextValidMap(szNextMap[]) { public voteMap() { new szVoteMap[128] - read_data(2, szVoteMap, 127) // "YO | Cheesy Peteza executed votemap 2 (co_angst 1/5)" + read_data(2, szVoteMap, charsmax(szVoteMap)) // "YO | Cheesy Peteza executed votemap 2 (co_angst 1/5)" new start, end, szData[64] for (new i; i