Skip to content

Commit

Permalink
Fixed|Multiplayer|Heretic: Activation of the Flight power (Wings or W…
Browse files Browse the repository at this point in the history
…rath)

When the Flight power is activated, the player is supposed to jump
a little into the air and start flying.
  • Loading branch information
skyjake committed Mar 18, 2013
1 parent 32770d7 commit f196aaf
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
19 changes: 19 additions & 0 deletions doomsday/plugins/common/src/d_netcl.c
Expand Up @@ -473,12 +473,31 @@ void NetCl_UpdatePlayerState(Reader *msg, int plrNum)
{
int val = ((b & (1 << i))? (Reader_ReadByte(msg) * 35) : 0);

/**
* @todo This function duplicates logic in P_GivePower(). The
* redundancy should be removed for instance by adding a new
* game packet GPT_GIVE_POWER that calls the appropriate
* P_GivePower() on clientside after it has been called on the
* server. -jk
*/

// Maybe unhide the HUD?
if(val > pl->powers[i])
ST_HUDUnHide(plrNum, HUE_ON_PICKUP_POWER);

pl->powers[i] = val;

if(val && i == PT_FLIGHT && pl->plr->mo)
{
pl->plr->mo->flags2 |= MF2_FLY;
pl->plr->mo->flags |= MF_NOGRAVITY;
pl->flyHeight = 10;
pl->powers[i] = val;
#ifdef _DEBUG
Con_Message("NetCl_UpdatePlayerState: Local mobj flight enabled.");
#endif
}

// Should we reveal the map?
if(val && i == PT_ALLMAP && plrNum == CONSOLEPLAYER)
{
Expand Down
4 changes: 2 additions & 2 deletions doomsday/plugins/common/src/p_view.c
Expand Up @@ -91,9 +91,9 @@ void P_CalcHeight(player_t* plr)
// When flying, don't bob the view.
if((pmo->flags2 & MF2_FLY) && pmo->origin[VZ] > pmo->floorZ)
{
#ifdef _DEBUG
/*#ifdef _DEBUG
Con_Message("Flying! z=%f flz=%f", pmo->origin[VZ], pmo->floorZ);
#endif
#endif*/
plr->bob = 1.0f / 2;
}

Expand Down

0 comments on commit f196aaf

Please sign in to comment.