Skip to content

Commit 55bbef2

Browse files
committed
fix: allow sar_startdemos on a directory
fall through to sar_startdemosfolder
1 parent 720b8ec commit 55bbef2

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Modules/EngineDemoPlayer.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,13 @@ CON_COMMAND_F_COMPLETION(sar_startdemos, "sar_startdemos <demoname> - improved v
507507

508508
std::string name = args[1];
509509

510+
std::string dirPath = fileSystem->FindFileSomewhere(name).value_or(name);
511+
if (std::filesystem::is_directory(dirPath)) {
512+
console->Print("%s is a directory. Using sar_startdemosfolder\n", dirPath.c_str());
513+
engine->ExecuteCommand(Utils::ssprintf("sar_startdemosfolder \"%s\"", dirPath.c_str()).c_str());
514+
return;
515+
}
516+
510517
if (name.length() > 4) {
511518
if (name.substr(name.length() - 4, 4) == ".dem")
512519
name.resize(name.length() - 4);

0 commit comments

Comments
 (0)