Don't allow too many arguments to be sent to the map command (#673)
`map` should only take a single arg that specifies the map to load.
This commit is contained in:
parent
026adbebe5
commit
e1eb2a6f4b
|
@ -200,7 +200,13 @@ AUTOHOOK(Host_Map_f, engine.dll + 0x15B340, void, __fastcall, (const CCommand& a
|
||||||
{
|
{
|
||||||
RefreshMapList();
|
RefreshMapList();
|
||||||
|
|
||||||
if (args.ArgC() > 1 &&
|
if (args.ArgC() > 2)
|
||||||
|
{
|
||||||
|
spdlog::warn("Map load failed: too many arguments provided");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else if (
|
||||||
|
args.ArgC() == 2 &&
|
||||||
std::find_if(vMapList.begin(), vMapList.end(), [&](MapVPKInfo map) -> bool { return map.name == args.Arg(1); }) == vMapList.end())
|
std::find_if(vMapList.begin(), vMapList.end(), [&](MapVPKInfo map) -> bool { return map.name == args.Arg(1); }) == vMapList.end())
|
||||||
{
|
{
|
||||||
spdlog::warn("Map load failed: {} not found or invalid", args.Arg(1));
|
spdlog::warn("Map load failed: {} not found or invalid", args.Arg(1));
|
||||||
|
|
Loading…
Reference in New Issue