diff options
-rw-r--r-- | src/game/g_cmds.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index 8e97b27e..8ed19769 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -1460,6 +1460,8 @@ void Cmd_Class_f( gentity_t *ent ) vec3_t mins, maxs; int num; gentity_t *other; + int oldBoostTime = -1; + vec3_t oldVel; clientNum = ent->client - level.clients; trap_Argv( 1, s, sizeof( s ) ); @@ -1593,7 +1595,6 @@ void Cmd_Class_f( gentity_t *ent ) { if( cost >= 0 ) { - int oldBoostTime = -1; ent->client->pers.evolveHealthFraction = (float)ent->client->ps.stats[ STAT_HEALTH ] / (float)BG_Class( currentClass )->health; @@ -1608,12 +1609,14 @@ void Cmd_Class_f( gentity_t *ent ) ent->client->pers.classSelection = newClass; ClientUserinfoChanged( clientNum ); VectorCopy( infestOrigin, ent->s.pos.trBase ); + VectorCopy( ent->client->ps.velocity, oldVel ); if( ent->client->ps.stats[ STAT_STATE ] & SS_BOOSTED ) oldBoostTime = ent->client->boostedTime; ClientSpawn( ent, ent, ent->s.pos.trBase, ent->s.apos.trBase ); + VectorCopy( oldVel, ent->client->ps.velocity ); if( oldBoostTime > 0 ) { ent->client->boostedTime = oldBoostTime; |