diff options
author | Christopher Schwarz <lakitu7@gmail.com> | 2009-10-20 18:14:08 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2013-01-03 00:16:57 +0000 |
commit | 9b6ee1b3aca16c2a513ac6c58e9d81942e0e3a4f (patch) | |
tree | 44641ac2c8d9af08fdc7020110c179e2d5136736 /src/game/g_cmds.c | |
parent | 0dc81b571ad4811d27a901c339afb96c4ca7a247 (diff) |
(bug 3545) Maintain velocity when evolving (Ben Millwood)
Diffstat (limited to 'src/game/g_cmds.c')
-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; |