diff options
author | /dev/humancontroller <devhc@example.com> | 2014-07-13 16:53:23 +0200 |
---|---|---|
committer | /dev/humancontroller <devhc@example.com> | 2017-03-09 13:51:10 +0100 |
commit | a284f3aa74fa543ad6384f56779d55a8d96d6a51 (patch) | |
tree | 28ff4730a0cf266ba4adefb8723f8bc5e130e12c | |
parent | ec12a6fcaa2474eaea1188b023e15d4ca587b8c8 (diff) |
when stopping follow mode, keep the view origin and stop
-rw-r--r-- | src/game/g_cmds.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index 85dd24f9..a83d386a 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -2604,10 +2604,19 @@ void G_StopFollowing( gentity_t *ent ) ent->client->ps.stats[ STAT_STATE ] = 0; ent->client->ps.stats[ STAT_VIEWLOCK ] = 0; ent->client->ps.eFlags &= ~( EF_WALLCLIMB | EF_WALLCLIMBCEILING ); - ent->client->ps.viewangles[ PITCH ] = 0.0f; ent->client->ps.clientNum = ent - g_entities; ent->client->ps.persistant[ PERS_CREDIT ] = ent->client->pers.credit; + if( ent->client->pers.teamSelection == TEAM_NONE ) + { + vec3_t viewOrigin, angles; + + BG_GetClientViewOrigin( &ent->client->ps, viewOrigin ); + VectorCopy( ent->client->ps.viewangles, angles ); + angles[ ROLL ] = 0; + TeleportPlayer( ent, viewOrigin, angles, qfalse ); + } + CalculateRanks( ); } |