diff options
author | Ben Millwood <thebenmachine@gmail.com> | 2009-10-03 11:36:27 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2013-01-03 00:15:09 +0000 |
commit | 641b11445262c54741585b3d1e0eaf0db7c49be4 (patch) | |
tree | 3c1de51586fd07d178088cf170551682f7fc2549 /src | |
parent | 9c8d696052505280dde7c12e7ee1666eeb793727 (diff) |
Keep poison through an evolution
Diffstat (limited to 'src')
-rw-r--r-- | src/game/g_cmds.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index 3c01256b..7ab24605 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -1659,6 +1659,8 @@ 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_FindHealthForClass( currentClass ); @@ -1672,7 +1674,17 @@ void Cmd_Class_f( gentity_t *ent ) ent->client->pers.classSelection = newClass; ClientUserinfoChanged( clientNum ); VectorCopy( infestOrigin, ent->s.pos.trBase ); + + if( ent->client->ps.stats[ STAT_STATE ] & SS_BOOSTED ) + oldBoostTime = ent->client->boostedTime; + ClientSpawn( ent, ent, ent->s.pos.trBase, ent->s.apos.trBase ); + + if( oldBoostedTime > 0 ) + { + ent->client->boostedTime = oldBoostTime; + ent->client->ps.stats[ STAT_STATE ] |= SS_BOOSTED; + } } else G_TriggerMenu2( clientNum, MN_A_CANTEVOLVE, newClass ); |