Skip to content

Commit 99fefca

Browse files
Charsi82Xottab-DUTY
authored andcommitted
Couple of fixes for Demo Record
- It won't start if the level is not loaded - Main menu will be hidden if it's shown
1 parent eeeb1e7 commit 99fefca

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

src/xrGame/console_commands.cpp

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -376,18 +376,21 @@ class CCC_ALifeSwitchFactor : public IConsole_Command
376376
class CCC_DemoRecord : public IConsole_Command
377377
{
378378
public:
379-
CCC_DemoRecord(LPCSTR N) : IConsole_Command(N){};
379+
CCC_DemoRecord(LPCSTR N) : IConsole_Command(N) {}
380380
virtual void Execute(LPCSTR args)
381381
{
382-
#ifndef DEBUG
383-
// if (GameID() != eGameIDSingle)
384-
//{
385-
// Msg("For this game type Demo Record is disabled.");
386-
// return;
387-
//};
388-
#endif
382+
if (!g_pGameLevel) // level not loaded
383+
{
384+
Log("Demo Record is disabled when level is not loaded.");
385+
return;
386+
}
387+
389388
Console->Hide();
390389

390+
// close main menu if it is open
391+
if (MainMenu()->IsActive())
392+
MainMenu()->Activate(false);
393+
391394
LPSTR fn_;
392395
STRCONCAT(fn_, args, ".xrdemo");
393396
string_path fn;

0 commit comments

Comments
 (0)