Skip to content

Commit

Permalink
Fixed|Hexen: Workaround for warping while dead
Browse files Browse the repository at this point in the history
IssueID #2357
  • Loading branch information
skyjake committed Dec 3, 2019
1 parent 7ae4d61 commit 92f3df8
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions doomsday/apps/plugins/common/src/game/g_game.cpp
Expand Up @@ -2816,6 +2816,17 @@ D_CMD(WarpMap)
P_SetMessageWithFlags(&players[CONSOLEPLAYER], "Cannot warp to the current map.", LMF_NO_HIDE);
return false;
}

// Restore health of dead players before modifying the game session. This is a workaround
// for IssueID #2357: dead players would be restored to zero-health zombies after the new
// map is loaded. The actual bug is likely in gamesession.cpp restorePlayersInHub().
for (int i = 0; i < MAXPLAYERS; ++i)
{
if (players[i].plr->inGame && players[i].playerState == PST_DEAD)
{
players[i].health = maxHealth; /// @todo: Game sessions vs. hubs needs to be debugged.
}
}
#endif

// Close any left open UIs.
Expand Down

0 comments on commit 92f3df8

Please sign in to comment.