mirror of
https://github.com/nzp-team/fteqw.git
synced 2025-02-17 01:11:18 +00:00
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:
parent
f2bc3029f8
commit
1120786c44
2 changed files with 20 additions and 13 deletions
|
@ -2030,9 +2030,11 @@ qboolean SV_Physics (void)
|
||||||
host_client = &svs.clients[i-1];
|
host_client = &svs.clients[i-1];
|
||||||
sv_player = host_client->edict;
|
sv_player = host_client->edict;
|
||||||
|
|
||||||
oldmovement[0] = sv_player->xv->movement[0];
|
//oldmovement[0] = sv_player->xv->movement[0];
|
||||||
oldmovement[1] = sv_player->xv->movement[1];
|
//oldmovement[1] = sv_player->xv->movement[1];
|
||||||
oldmovement[2] = sv_player->xv->movement[2];
|
//oldmovement[2] = sv_player->xv->movement[2];
|
||||||
|
|
||||||
|
SV_PreRunCmd();
|
||||||
|
|
||||||
ucmd.msec = host_frametime*1000;
|
ucmd.msec = host_frametime*1000;
|
||||||
ucmd.angles[0] = (unsigned short)(sv_player->v->angles[0] * (65535/360.0f));
|
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.
|
svs.clients[i-1].lastcmd = ucmd; //allow the other clients to predict this bot.
|
||||||
|
|
||||||
SV_PreRunCmd();
|
|
||||||
SV_RunCmd(&ucmd, false);
|
SV_RunCmd(&ucmd, false);
|
||||||
SV_PostRunCmd();
|
SV_PostRunCmd();
|
||||||
|
|
||||||
sv_player->xv->movement[0] = oldmovement[0];
|
//sv_player->xv->movement[0] = oldmovement[0];
|
||||||
sv_player->xv->movement[1] = oldmovement[1];
|
//sv_player->xv->movement[1] = oldmovement[1];
|
||||||
sv_player->xv->movement[2] = oldmovement[2];
|
//sv_player->xv->movement[2] = oldmovement[2];
|
||||||
|
|
||||||
host_client = oldhost;
|
host_client = oldhost;
|
||||||
sv_player = oldplayer;
|
sv_player = oldplayer;
|
||||||
|
|
|
@ -4612,9 +4612,12 @@ void SV_RunCmd (usercmd_t *ucmd, qboolean recurse)
|
||||||
sv_player->v->button0 = 0;
|
sv_player->v->button0 = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
sv_player->xv->movement[0] = ucmd->forwardmove * host_frametime;
|
if (host_client->state && host_client->protocol != SCP_BAD)
|
||||||
sv_player->xv->movement[1] = ucmd->sidemove * host_frametime;
|
{
|
||||||
sv_player->xv->movement[2] = ucmd->upmove * host_frametime;
|
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);
|
SV_CheckVelocity(sv_player);
|
||||||
|
|
||||||
|
@ -5920,9 +5923,12 @@ void SV_ClientThink (void)
|
||||||
cmd = host_client->lastcmd;
|
cmd = host_client->lastcmd;
|
||||||
sv_player = host_client->edict;
|
sv_player = host_client->edict;
|
||||||
|
|
||||||
sv_player->xv->movement[0] = cmd.forwardmove;
|
if (host_client->state && host_client->protocol != SCP_BAD)
|
||||||
sv_player->xv->movement[1] = cmd.sidemove;
|
{
|
||||||
sv_player->xv->movement[2] = cmd.upmove;
|
sv_player->xv->movement[0] = cmd.forwardmove;
|
||||||
|
sv_player->xv->movement[1] = cmd.sidemove;
|
||||||
|
sv_player->xv->movement[2] = cmd.upmove;
|
||||||
|
}
|
||||||
|
|
||||||
if (SV_PlayerPhysicsQC)
|
if (SV_PlayerPhysicsQC)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue