Skip to content

Commit

Permalink
All Games|libcommon: Copy GameRules when -warp'ing to another episode
Browse files Browse the repository at this point in the history
If a game is currently in progress when -warp'ing to a map in another
episode - copy the existing GameRules; otherwise use the defaults for
the game session. (Match vanilla behavior).
  • Loading branch information
danij-deng committed Nov 28, 2014
1 parent 38cf13f commit 67a2e40
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion doomsday/plugins/common/src/g_game.cpp
Expand Up @@ -2765,7 +2765,10 @@ D_CMD(WarpMap)
}
else
{
G_SetGameActionNewSession(defaultGameRules, episodeId, mapUri);
// If a session is already in progress then copy the rules from it.
GameRuleset const rules = (COMMON_GAMESESSION->hasBegun()? COMMON_GAMESESSION->rules()
: defaultGameRules);
G_SetGameActionNewSession(rules, episodeId, mapUri);
}

// If the command source was "us" the game library then it was probably in
Expand Down

0 comments on commit 67a2e40

Please sign in to comment.