- fixed bug where the menu map parser truncated lines and thus gave IsMapValid() weird results

- fixed a bug where kicking yourself could throw an RTE

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401664
This commit is contained in:
David Anderson 2007-10-31 05:26:08 +00:00
parent 00682b7782
commit 30f3067827
2 changed files with 15 additions and 6 deletions

View File

@ -141,7 +141,10 @@ public Action:Command_Kick(client, args)
{
kick_self = client;
}
PerformKick(client, target_list[i], Arguments[len]);
else
{
PerformKick(client, target_list[i], Arguments[len]);
}
}
if (kick_self)

View File

@ -120,22 +120,28 @@ LoadMapList(Handle:menu)
return LoadMapFolder(menu);
}
decl String:buffer[64], len;
decl String:buffer[256], len;
while (!IsEndOfFile(file) && ReadFileLine(file, buffer, sizeof(buffer)))
{
TrimString(buffer);
if ((len = StrContains(buffer, ".bsp", false)) != -1)
{
buffer[len] = '\0';
}
if (buffer[0] == '\0' || !IsValidConVarChar(buffer[0]) || !IsMapValid(buffer))
if (buffer[0] == '\0'
|| buffer[0] == ';'
|| buffer[0] == '/'
|| !IsValidConVarChar(buffer[0]))
{
continue;
}
AddMenuItem(menu, buffer, buffer);
if (IsMapValid(buffer))
{
AddMenuItem(menu, buffer, buffer);
}
}
CloseHandle(file);