Skip to content

Commit e1eb2a6

Browse files
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.
1 parent 026adbe commit e1eb2a6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

primedev/util/printmaps.cpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,13 @@ AUTOHOOK(Host_Map_f, engine.dll + 0x15B340, void, __fastcall, (const CCommand& a
200200
{
201201
RefreshMapList();
202202

203-
if (args.ArgC() > 1 &&
203+
if (args.ArgC() > 2)
204+
{
205+
spdlog::warn("Map load failed: too many arguments provided");
206+
return;
207+
}
208+
else if (
209+
args.ArgC() == 2 &&
204210
std::find_if(vMapList.begin(), vMapList.end(), [&](MapVPKInfo map) -> bool { return map.name == args.Arg(1); }) == vMapList.end())
205211
{
206212
spdlog::warn("Map load failed: {} not found or invalid", args.Arg(1));

0 commit comments

Comments
 (0)