May I ask someone knowledgeable what exactly is the issue with pistol start support and why it cannot be added to GZDoom?
I am looking at g_game.cpp in GZDoom 4.7.1 right now:
Code: Select all
void FLevelLocals::DoReborn (int playernum, bool freshbot)
{
if (!multiplayer && !(flags2 & LEVEL2_ALLOWRESPAWN) && !sv_singleplayerrespawn &&
!G_SkillProperty(SKILLP_PlayerRespawn))
{
if (BackupSaveName.Len() > 0 && FileExists (BackupSaveName.GetChars()))
{ // Load game from the last point it was saved
savename = BackupSaveName;
gameaction = ga_autoloadgame;
}
else
{ // Reload the level from scratch
bool indemo = demoplayback;
BackupSaveName = "";
G_InitNew (MapName, false);
demoplayback = indemo;
}
}
Why exactly can't this solution work?
if (BackupSaveName.Len() > 0 && FileExists (BackupSaveName.GetChars())
&& Options.getSomeNewRandomCvar() == 0)
{ // Load game from the last point it was saved
savename = BackupSaveName;
gameaction = ga_autoloadgame;
}
For example... I've added
Code: Select all
CVAR(Bool, pistolstartafterdeath, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
doommenu.cpp
and changed g_game.cpp to
Code: Select all
//
// G_DoReborn
//
EXTERN_CVAR(Bool, sv_singleplayerrespawn)
EXTERN_CVAR(Bool, pistolstartafterdeath)
void FLevelLocals::DoReborn (int playernum, bool freshbot)
{
if (!multiplayer && !(flags2 & LEVEL2_ALLOWRESPAWN) && !sv_singleplayerrespawn &&
!G_SkillProperty(SKILLP_PlayerRespawn))
{
if (BackupSaveName.Len() > 0 && FileExists (BackupSaveName.GetChars()) && !pistolstartafterdeath)
{ // Load game from the last point it was saved
savename = BackupSaveName;
gameaction = ga_autoloadgame;
}
...and everything works perfectly? And if I'll ever play mods/wads which would require to start the game from the save file, I would just set pistolstartafterdeath to 0.
I am not a coder, so please explain what's wrong with this solution?
May I ask someone knowledgeable what exactly is the issue with pistol start support and why it cannot be added to GZDoom?
I am looking at g_game.cpp in GZDoom 4.7.1 right now:
[code]void FLevelLocals::DoReborn (int playernum, bool freshbot)
{
if (!multiplayer && !(flags2 & LEVEL2_ALLOWRESPAWN) && !sv_singleplayerrespawn &&
!G_SkillProperty(SKILLP_PlayerRespawn))
{
if (BackupSaveName.Len() > 0 && FileExists (BackupSaveName.GetChars()))
{ // Load game from the last point it was saved
savename = BackupSaveName;
gameaction = ga_autoloadgame;
}
else
{ // Reload the level from scratch
bool indemo = demoplayback;
BackupSaveName = "";
G_InitNew (MapName, false);
demoplayback = indemo;
}
}[/code]
Why exactly can't this solution work?
if (BackupSaveName.Len() > 0 && FileExists (BackupSaveName.GetChars())[b] && Options.getSomeNewRandomCvar() == 0[/b])
{ // Load game from the last point it was saved
savename = BackupSaveName;
gameaction = ga_autoloadgame;
}
For example... I've added
[code]CVAR(Bool, pistolstartafterdeath, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)[/code]
doommenu.cpp
and changed g_game.cpp to
[code]
//
// G_DoReborn
//
EXTERN_CVAR(Bool, sv_singleplayerrespawn)
EXTERN_CVAR(Bool, pistolstartafterdeath)
void FLevelLocals::DoReborn (int playernum, bool freshbot)
{
if (!multiplayer && !(flags2 & LEVEL2_ALLOWRESPAWN) && !sv_singleplayerrespawn &&
!G_SkillProperty(SKILLP_PlayerRespawn))
{
if (BackupSaveName.Len() > 0 && FileExists (BackupSaveName.GetChars()) && !pistolstartafterdeath)
{ // Load game from the last point it was saved
savename = BackupSaveName;
gameaction = ga_autoloadgame;
}
[/code]
...and everything works perfectly? And if I'll ever play mods/wads which would require to start the game from the save file, I would just set pistolstartafterdeath to 0.
I am not a coder, so please explain what's wrong with this solution?