Skip to content

Commit

Permalink
libcommon: Resolve map cycle rules using "warp numbers"
Browse files Browse the repository at this point in the history
Unfortunately Hexen's map cycle rules use warp numbers. This means
that an on-going game session is a prerequisite for resolving such
rules (otherwise specification of the episode ID would be necessary
within the cycle, like the other games).
  • Loading branch information
danij-deng committed Aug 12, 2014
1 parent c0aa215 commit 237770b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions doomsday/plugins/common/src/d_netsv.cpp
Expand Up @@ -230,6 +230,10 @@ static void NetSv_CycleToMapNum(de::Uri const &mapUri)
/**
* Reads through the MapCycle cvar and finds the map with the given index.
* Rules that apply to the map are returned in 'rules'.
*
* @pre The game session has already begun. Necessary because the cycle rules
* for Hexen reference maps by "warp numbers", which, can only be resolved in
* the context of an episode.
*/
static de::Uri NetSv_ScanCycle(int index, maprule_t *rules = 0)
{
Expand Down Expand Up @@ -324,7 +328,6 @@ static de::Uri NetSv_ScanCycle(int index, maprule_t *rules = 0)
#if !__JHEXEN__
uint episode = 0;
#endif

#if __JDOOM__
if(!(gameModeBits & GM_ANY_DOOM2))
{
Expand All @@ -349,7 +352,7 @@ static de::Uri NetSv_ScanCycle(int index, maprule_t *rules = 0)

#if __JHEXEN__
// In Hexen map numbers must be translated (urgh...).
de::Uri mapUri = TranslateMapWarpNumber(map);
de::Uri mapUri = TranslateMapWarpNumber(COMMON_GAMESESSION->episodeId(), map);
#else
de::Uri mapUri = G_ComposeMapUri(episode, map);
#endif
Expand Down

0 comments on commit 237770b

Please sign in to comment.