Skip to content

Commit

Permalink
Fixed: "HeXen: Unused Wings of Wrath not taken between hubs" (see here
Browse files Browse the repository at this point in the history
  • Loading branch information
danij-deng committed Nov 7, 2009
1 parent 5d34e3c commit 38dea76
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions doomsday/plugins/common/src/g_game.c
Expand Up @@ -1240,35 +1240,34 @@ Con_Message("G_Ticker: Removing player %i's mobj.\n", i);
*/
void G_PlayerLeaveMap(int player)
{
#if __JHERETIC__
uint i;
#endif
#if __JHEXEN__
int flightPower;
#if __JHERETIC__ || __JHEXEN__
uint i;
int flightPower;
#endif
player_t* p = &players[player];
boolean newCluster;
player_t* p = &players[player];
boolean newCluster;

#if __JHEXEN__ || __JSTRIFE__
newCluster = (P_GetMapCluster(gameMap) != P_GetMapCluster(leaveMap));
#else
newCluster = true;
#endif

// Remember if flying
flightPower = p->powers[PT_FLIGHT];

#if __JHERETIC__
// Empty the inventory of excess items
for(i = 0; i < NUM_INVENTORYITEM_TYPES; ++i)
{
inventoryitemtype_t type = IIT_FIRST + i;
uint count = P_InventoryCount(player, type);
uint count = P_InventoryCount(player, type);

if(count)
{
uint j;
uint j;

// When entering a new cluster. strip ALL flight items,
// otherwise leave the player one of each type.
if(!(type == IIT_FLY && !deathmatch && newCluster))
if(type != IIT_FLY)
count--;

for(j = 0; j < count; ++j)
Expand All @@ -1277,9 +1276,14 @@ void G_PlayerLeaveMap(int player)
}
#endif

// Remember if flying
#if __JHEXEN__
flightPower = p->powers[PT_FLIGHT];
if(newCluster)
{
uint count = P_InventoryCount(player, IIT_FLY);

for(i = 0; i < count; ++i)
P_InventoryTake(player, IIT_FLY, true);
}
#endif

// Remove their powers.
Expand Down

0 comments on commit 38dea76

Please sign in to comment.