diff options
author | /dev/humancontroller <devhc@example.com> | 2015-02-02 17:19:53 +0100 |
---|---|---|
committer | /dev/humancontroller <devhc@example.com> | 2017-03-09 13:51:15 +0100 |
commit | 3082ad368b015ed8d9403aae85ca571de52ed1f0 (patch) | |
tree | cd26e05d1f46c2f911e49d8a18bc5b001bb06724 | |
parent | c5d690640c0095eda87495dc70346544ee013731 (diff) |
try to synchronize ent->r.currentAngles with ent->client->ps.viewangles a bit
-rw-r--r-- | src/game/g_active.c | 3 | ||||
-rw-r--r-- | src/game/g_client.c | 3 | ||||
-rw-r--r-- | src/game/g_misc.c | 1 |
3 files changed, 6 insertions, 1 deletions
diff --git a/src/game/g_active.c b/src/game/g_active.c index e22ecb1f..0ebb30ec 100644 --- a/src/game/g_active.c +++ b/src/game/g_active.c @@ -484,6 +484,8 @@ void SpectatorThink( gentity_t *ent, usercmd_t *ucmd ) // Save results of pmove VectorCopy( client->ps.origin, ent->s.pos.trBase ); VectorCopy( client->ps.origin, ent->r.currentOrigin ); + VectorCopy( client->ps.viewangles, ent->r.currentAngles ); + VectorCopy( client->ps.viewangles, ent->s.pos.trBase ); G_TouchTriggers( ent ); trap_UnlinkEntity( ent ); @@ -1559,6 +1561,7 @@ void ClientThink_real( gentity_t *ent ) if( ent->client->ps.eventSequence != oldEventSequence ) ent->eventTime = level.time; + VectorCopy( ent->client->ps.viewangles, ent->r.currentAngles ); if( g_smoothClients.integer ) BG_PlayerStateToEntityStateExtraPolate( &ent->client->ps, &ent->s, ent->client->ps.commandTime, qtrue ); else diff --git a/src/game/g_client.c b/src/game/g_client.c index b8fb8055..5c355652 100644 --- a/src/game/g_client.c +++ b/src/game/g_client.c @@ -1482,11 +1482,12 @@ void ClientSpawn( gentity_t *ent, gentity_t *spawn, vec3_t origin, vec3_t angles ent->client->pers.cmd.serverTime = level.time; ClientThink( ent-g_entities ); + VectorCopy( ent->client->ps.viewangles, ent->r.currentAngles ); + VectorCopy( ent->client->ps.origin, ent->r.currentOrigin ); // positively link the client, even if the command times are weird if( client->sess.spectatorState == SPECTATOR_NOT ) { BG_PlayerStateToEntityState( &client->ps, &ent->s, qtrue ); - VectorCopy( ent->client->ps.origin, ent->r.currentOrigin ); trap_LinkEntity( ent ); } diff --git a/src/game/g_misc.c b/src/game/g_misc.c index 87b13c7a..8c667ad4 100644 --- a/src/game/g_misc.c +++ b/src/game/g_misc.c @@ -102,6 +102,7 @@ void TeleportPlayer( gentity_t *player, vec3_t origin, vec3_t angles, float spee // use the precise origin for linking VectorCopy( player->client->ps.origin, player->r.currentOrigin ); + VectorCopy( player->client->ps.viewangles, player->r.currentAngles ); if( player->client->sess.spectatorState == SPECTATOR_NOT ) { |