A better botclient movement code, hopefully fully operational this time.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2726 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Molgrum 2007-10-08 12:23:55 +00:00
parent f2bc3029f8
commit 1120786c44
2 changed files with 20 additions and 13 deletions

View File

@ -2030,9 +2030,11 @@ qboolean SV_Physics (void)
host_client = &svs.clients[i-1];
sv_player = host_client->edict;
oldmovement[0] = sv_player->xv->movement[0];
oldmovement[1] = sv_player->xv->movement[1];
oldmovement[2] = sv_player->xv->movement[2];
//oldmovement[0] = sv_player->xv->movement[0];
//oldmovement[1] = sv_player->xv->movement[1];
//oldmovement[2] = sv_player->xv->movement[2];
SV_PreRunCmd();
ucmd.msec = host_frametime*1000;
ucmd.angles[0] = (unsigned short)(sv_player->v->angles[0] * (65535/360.0f));
@ -2045,13 +2047,12 @@ qboolean SV_Physics (void)
svs.clients[i-1].lastcmd = ucmd; //allow the other clients to predict this bot.
SV_PreRunCmd();
SV_RunCmd(&ucmd, false);
SV_PostRunCmd();
sv_player->xv->movement[0] = oldmovement[0];
sv_player->xv->movement[1] = oldmovement[1];
sv_player->xv->movement[2] = oldmovement[2];
//sv_player->xv->movement[0] = oldmovement[0];
//sv_player->xv->movement[1] = oldmovement[1];
//sv_player->xv->movement[2] = oldmovement[2];
host_client = oldhost;
sv_player = oldplayer;

View File

@ -4612,9 +4612,12 @@ void SV_RunCmd (usercmd_t *ucmd, qboolean recurse)
sv_player->v->button0 = 0;
}
sv_player->xv->movement[0] = ucmd->forwardmove * host_frametime;
sv_player->xv->movement[1] = ucmd->sidemove * host_frametime;
sv_player->xv->movement[2] = ucmd->upmove * host_frametime;
if (host_client->state && host_client->protocol != SCP_BAD)
{
sv_player->xv->movement[0] = ucmd->forwardmove * host_frametime;
sv_player->xv->movement[1] = ucmd->sidemove * host_frametime;
sv_player->xv->movement[2] = ucmd->upmove * host_frametime;
}
SV_CheckVelocity(sv_player);
@ -5920,9 +5923,12 @@ void SV_ClientThink (void)
cmd = host_client->lastcmd;
sv_player = host_client->edict;
sv_player->xv->movement[0] = cmd.forwardmove;
sv_player->xv->movement[1] = cmd.sidemove;
sv_player->xv->movement[2] = cmd.upmove;
if (host_client->state && host_client->protocol != SCP_BAD)
{
sv_player->xv->movement[0] = cmd.forwardmove;
sv_player->xv->movement[1] = cmd.sidemove;
sv_player->xv->movement[2] = cmd.upmove;
}
if (SV_PlayerPhysicsQC)
{