Commit 01f10a60 authored by Richard Gobeille's avatar Richard Gobeille
Browse files

Duke3d: fix map console command to work correctly with coroutine setup

Adds MODE_NEWGAME to player .gm
parent cd55f332
......@@ -6900,45 +6900,52 @@ MAIN_LOOP_RESTART:
G_SetCrosshairColor(CrosshairColors.r, CrosshairColors.g, CrosshairColors.b);
}
if (ud.warp_on == 1)
if (myplayer.gm & MODE_NEWGAME)
{
G_NewGame_EnterLevel();
// may change ud.warp_on in an error condition
G_NewGame(ud.m_volume_number, ud.m_level_number, ud.m_player_skill);
myplayer.gm = MODE_RESTART;
}
if (ud.warp_on == 0)
else
{
if ((g_netServer || ud.multimode > 1) && boardfilename[0] != 0)
if (ud.warp_on == 1)
{
ud.m_level_number = 7;
ud.m_volume_number = 0;
ud.m_respawn_monsters = !!(ud.m_player_skill == 4);
G_NewGame_EnterLevel();
// may change ud.warp_on in an error condition
}
for (int TRAVERSE_CONNECT(i))
if (ud.warp_on == 0)
{
if ((g_netServer || ud.multimode > 1) && boardfilename[0] != 0)
{
P_ResetWeapons(i);
P_ResetInventory(i);
}
ud.m_level_number = 7;
ud.m_volume_number = 0;
ud.m_respawn_monsters = !!(ud.m_player_skill == 4);
G_NewGame_EnterLevel();
for (int TRAVERSE_CONNECT(i))
{
P_ResetWeapons(i);
P_ResetInventory(i);
}
Net_WaitForServer();
}
else if (g_networkMode != NET_DEDICATED_SERVER)
G_DisplayLogo();
G_NewGame_EnterLevel();
if (g_networkMode != NET_DEDICATED_SERVER)
{
if (G_PlaybackDemo())
Net_WaitForServer();
}
else if (g_networkMode != NET_DEDICATED_SERVER)
G_DisplayLogo();
if (g_networkMode != NET_DEDICATED_SERVER)
{
FX_StopAllSounds();
g_noLogoAnim = 1;
goto MAIN_LOOP_RESTART;
if (G_PlaybackDemo())
{
FX_StopAllSounds();
g_noLogoAnim = 1;
goto MAIN_LOOP_RESTART;
}
}
}
else G_UpdateScreenArea();
}
else G_UpdateScreenArea();
// G_GameExit(" "); ///
// ud.auto_run = ud.config.RunMode;
......@@ -7020,6 +7027,9 @@ MAIN_LOOP_RESTART:
G_DoCheats();
if (myplayer.gm & MODE_NEWGAME)
goto MAIN_LOOP_RESTART;
if (myplayer.gm & (MODE_EOL|MODE_RESTART))
{
switch (G_EndOfLevel())
......
......@@ -269,10 +269,7 @@ static int osdcmd_map(osdcmdptr_t parm)
ud.multimode = 1;
if (g_player[myconnectindex].ps->gm & MODE_GAME)
{
G_NewGame(ud.m_volume_number, ud.m_level_number, ud.m_player_skill);
g_player[myconnectindex].ps->gm = MODE_RESTART;
}
g_player[myconnectindex].ps->gm = MODE_RESTART|MODE_NEWGAME;
else G_NewGame_EnterLevel();
return OSDCMD_OK;
......
......@@ -125,6 +125,7 @@ enum gamemode_t {
MODE_TYPE = 0x00000010,
MODE_RESTART = 0x00000020,
MODE_SENDTOWHOM = 0x00000040,
MODE_NEWGAME = 0x00000080,
};
// Player Actions.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment