Skip to content

Commit

Permalink
Working on remote player movement
Browse files Browse the repository at this point in the history
Smoothers are cleared when map changes.
All remote players (on client and server) get unlimited step-ups.
  • Loading branch information
skyjake committed Jul 24, 2011
1 parent ddf8c7c commit 7d4f17d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
14 changes: 9 additions & 5 deletions doomsday/engine/portable/src/cl_mobj.c
Expand Up @@ -379,10 +379,14 @@ void Cl_UpdateRealPlayerMobj(mobj_t *localMobj, mobj_t *remoteClientMobj, int fl
}
if(flags & MDF_POS_Z)
{
if(onFloor)
// Stay on the floor if the mobj is locally touching the right plane.
if(onFloor) // && localMobj->floorZ == localMobj->subsector->sector->planes[PLN_FLOOR]->height)
{
// It's supposed to be on the local floor Z.
remoteClientMobj->pos[VZ] = remoteClientMobj->floorZ = localMobj->floorZ;
// if(
// {
// It's supposed to be on the local floor Z.
// remoteClientMobj->pos[VZ] = remoteClientMobj->floorZ = localMobj->floorZ;
//}
}
else
{
Expand Down Expand Up @@ -827,13 +831,13 @@ void ClMobj_ReadDelta2(boolean skip)
d->ceilingZ = Msg_ReadFloat();
}

#if _DEBUG
/*#if _DEBUG
if((df & MDF_POS_Z) && d->dPlayer && P_GetDDPlayerIdx(d->dPlayer) != consolePlayer)
{
Con_Message("ClMobj_ReadDelta2: Player=%i z=%f onFloor=%i\n", P_GetDDPlayerIdx(d->dPlayer),
d->pos[VZ], onFloor);
}
#endif
#endif*/

/*
// When these flags are set, the normal Z coord is not included.
Expand Down
7 changes: 7 additions & 0 deletions doomsday/engine/portable/src/net_main.c
Expand Up @@ -342,7 +342,14 @@ void Net_ShowChatMessage(void)
*/
void Net_ResetTimer(void)
{
int i;

firstNetUpdate = true;

for(i = 0; i < DDMAXPLAYERS; ++i)
{
Smoother_Clear(clients[i].smoother);
}
}

/**
Expand Down
4 changes: 3 additions & 1 deletion doomsday/plugins/common/src/p_map.c
Expand Up @@ -33,6 +33,7 @@
#include <stdio.h>
#include <string.h>

#include "doomsday.h"
#if __JDOOM__
# include "jdoom.h"
#elif __JDOOM64__
Expand Down Expand Up @@ -1240,7 +1241,8 @@ static boolean P_TryMove2(mobj_t* thing, float x, float y, boolean dropoff)
float oldpos[3];
int side, oldSide;
linedef_t* ld;
boolean isRemotePlayer = (IS_DEDICATED && thing->dPlayer);
boolean isRemotePlayer = ((IS_DEDICATED && thing->dPlayer) ||
(IS_CLIENT && thing->player && thing->player - players != CONSOLEPLAYER));

// $dropoff_fix: fellDown.
floatOk = false;
Expand Down

0 comments on commit 7d4f17d

Please sign in to comment.