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:
parent
2943747add
commit
dd0ed78774
@ -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;
|
||||
}
|
||||
|
@ -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();
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user