Skip to content

Commit

Permalink
Fixed (All games): Climbing a step into a teleporter results in the p…
Browse files Browse the repository at this point in the history
…layer squating briefly after teleportation.
  • Loading branch information
danij-deng committed Mar 7, 2010
1 parent c0d8f3f commit 08a6c26
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
4 changes: 3 additions & 1 deletion doomsday/plugins/jdoom/src/p_telept.c
Expand Up @@ -183,7 +183,7 @@ int EV_Teleport(linedef_t* line, int side, mobj_t* mo, boolean spawnFog)
if(mo->player)
{
mo->reactionTime = 18;
if(mo->player->powers[PT_FLIGHT] && aboveFloor)
if(mo->player->powers[PT_FLIGHT] && aboveFloor > 0)
{
mo->pos[VZ] = mo->floorZ + aboveFloor;
if(mo->pos[VZ] + mo->height > mo->ceilingZ)
Expand All @@ -196,6 +196,8 @@ int EV_Teleport(linedef_t* line, int side, mobj_t* mo, boolean spawnFog)
//mo->dPlayer->clLookDir = 0; /* $unifiedangles */
mo->dPlayer->lookDir = 0;
}
mo->player->viewHeight = (float) cfg.plrViewHeight;
mo->player->viewHeightDelta = 0;
mo->player->viewZ = mo->pos[VZ] + mo->player->viewHeight;

//mo->dPlayer->clAngle = mo->angle; /* $unifiedangles */
Expand Down
4 changes: 3 additions & 1 deletion doomsday/plugins/jdoom64/src/p_telept.c
Expand Up @@ -185,7 +185,7 @@ int EV_Teleport(linedef_t* line, int side, mobj_t* mo, boolean spawnFog)
if(mo->player)
{
mo->reactionTime = 18;
if(mo->player->powers[PT_FLIGHT] && aboveFloor)
if(mo->player->powers[PT_FLIGHT] && aboveFloor > 0)
{
mo->pos[VZ] = mo->floorZ + aboveFloor;
if(mo->pos[VZ] + mo->height > mo->ceilingZ)
Expand All @@ -198,6 +198,8 @@ int EV_Teleport(linedef_t* line, int side, mobj_t* mo, boolean spawnFog)
//mo->dPlayer->clLookDir = 0; /* $unifiedangles */
mo->dPlayer->lookDir = 0;
}
mo->player->viewHeight = (float) cfg.plrViewHeight;
mo->player->viewHeightDelta = 0;
mo->player->viewZ = mo->pos[VZ] + mo->player->viewHeight;

//mo->dPlayer->clAngle = mo->angle; /* $unifiedangles */
Expand Down
4 changes: 3 additions & 1 deletion doomsday/plugins/jheretic/src/p_telept.c
Expand Up @@ -82,7 +82,7 @@ boolean P_Teleport(mobj_t* thing, float x, float y, angle_t angle,
if(thing->player)
{
player = thing->player;
if(player->powers[PT_FLIGHT] && aboveFloor)
if(player->powers[PT_FLIGHT] && aboveFloor > 0)
{
thing->pos[VZ] = thing->floorZ + aboveFloor;
if(thing->pos[VZ] + thing->height > thing->ceilingZ)
Expand All @@ -94,6 +94,8 @@ boolean P_Teleport(mobj_t* thing, float x, float y, angle_t angle,
else
{
thing->pos[VZ] = thing->floorZ;
player->viewHeight = (float) cfg.plrViewHeight;
player->viewHeightDelta = 0;
player->viewZ = thing->pos[VZ] + player->viewHeight;
//player->plr->clLookDir = 0; /* $unifiedangles */
player->plr->lookDir = 0;
Expand Down
4 changes: 3 additions & 1 deletion doomsday/plugins/jhexen/src/p_telept.c
Expand Up @@ -124,7 +124,7 @@ boolean P_Teleport(mobj_t* mo, float x, float y, angle_t angle,
{
player = mo->player;
player->plr->flags |= DDPF_FIXANGLES | DDPF_FIXPOS | DDPF_FIXMOM;
if(player->powers[PT_FLIGHT] && aboveFloor)
if(player->powers[PT_FLIGHT] && aboveFloor > 0)
{
mo->pos[VZ] = mo->floorZ + aboveFloor;
if(mo->pos[VZ] + mo->height > mo->ceilingZ)
Expand All @@ -136,6 +136,8 @@ boolean P_Teleport(mobj_t* mo, float x, float y, angle_t angle,
else
{
mo->pos[VZ] = mo->floorZ;
player->viewHeight = (float) cfg.plrViewHeight;
player->viewHeightDelta = 0;
player->viewZ = mo->pos[VZ] + player->viewHeight;
if(useFog)
{
Expand Down

0 comments on commit 08a6c26

Please sign in to comment.