1
0
forked from 0ad/0ad

Follow proper Shutdown sequence when using -dumpSchema, fixes #6696.

Also fix an incorrect code comment, and prevent Atlas from being started
with `-dumpSchema`.

Reviewed By: phosit
Differential Revision: https://code.wildfiregames.com/D4903
This was SVN commit r27470.
This commit is contained in:
Nicolas Auvray 2023-01-19 22:34:46 +00:00
parent 2943747add
commit dd0ed78774
3 changed files with 14 additions and 7 deletions

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2014 Wildfire Games.
/* Copyright (C) 2023 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@ -74,6 +74,12 @@ bool ATLAS_RunIfOnCmdLine(const CmdLineArgs& args, bool force)
{
if (force || args.Has("editor"))
{
if (args.Has("dumpSchema"))
{
LOGERROR("-dumpSchema and -editor arguments are incompatible: Atlas will not be started.");
return false;
}
ATLAS_Run(args, ATLAS_NO_GUI);
return true;
}

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2022 Wildfire Games.
/* Copyright (C) 2023 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@ -596,8 +596,8 @@ bool Init(const CmdLineArgs& args, int flags)
sim.LoadDefaultScripts();
std::ofstream f("entity.rng", std::ios_base::out | std::ios_base::trunc);
f << sim.GenerateSchema();
std::cout << "Generated entity.rng\n";
exit(0);
debug_printf("Generated entity.rng\n");
return false;
}
CNetHost::Initialize();

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2022 Wildfire Games.
/* Copyright (C) 2023 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@ -73,8 +73,9 @@ extern const std::vector<CStr>& GetMods(const CmdLineArgs& args, int flags);
extern void MountMods(const Paths& paths, const std::vector<CStr>& mods);
/**
* Returns true if successful, false if mods changed and restart_engine was called.
* In the latter case the caller should call Shutdown() with SHUTDOWN_FROM_CONFIG.
* Returns true if successful, false if Init is aborted early (for instance if
* mods changed, or if we are using -dumpSchema).
* If false is returned, the caller should call Shutdown() with SHUTDOWN_FROM_CONFIG.
*/
extern bool Init(const CmdLineArgs& args, int flags);
extern void InitInput();