diff options
author | Roman Tetelman <kevlarman@gmail.com> | 2009-10-03 13:13:20 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2013-01-03 00:16:34 +0000 |
commit | e99b7e92d6b584839539f1f79f9e5f6fb996e0fa (patch) | |
tree | 325f5a960ef0d57626455b26af3e220ae455a7ac /src | |
parent | 5fc34b0cf5ed4b235a09749d9ff95b923ae29e24 (diff) |
* fix some more credit copying issues
Diffstat (limited to 'src')
-rw-r--r-- | src/game/g_active.c | 2 | ||||
-rw-r--r-- | src/game/g_cmds.c | 7 | ||||
-rw-r--r-- | src/game/g_team.c | 10 |
3 files changed, 9 insertions, 10 deletions
diff --git a/src/game/g_active.c b/src/game/g_active.c index b2f6f9ca..5eb5d3d1 100644 --- a/src/game/g_active.c +++ b/src/game/g_active.c @@ -1735,7 +1735,7 @@ void ClientThink_real( gentity_t *ent ) if( i == num && client->ps.stats[ STAT_TEAM ] == TEAM_ALIENS ) { if( BG_AlienCanEvolve( client->ps.stats[ STAT_CLASS ], - client->ps.persistant[ PERS_CREDIT ], + client->pers.credit, g_alienStage.integer ) ) { //no nearby objects and alien - show class menu diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index f6164ac8..163a3feb 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -1848,7 +1848,7 @@ void Cmd_Class_f( gentity_t *ent ) } cost = BG_ClassCanEvolveFromTo( currentClass, newClass, - ent->client->ps.persistant[ PERS_CREDIT ], + ent->client->pers.credit, g_alienStage.integer, 0 ); if( G_RoomForClassChange( ent, newClass, infestOrigin ) ) @@ -2186,7 +2186,7 @@ void Cmd_Buy_f( gentity_t *ent ) } //can afford this? - if( BG_Weapon( weapon )->price > (short)ent->client->ps.persistant[ PERS_CREDIT ] ) + if( BG_Weapon( weapon )->price > (short)ent->client->pers.credit ) { G_TriggerMenu( ent->client->ps.clientNum, MN_H_NOFUNDS ); return; @@ -2229,7 +2229,7 @@ void Cmd_Buy_f( gentity_t *ent ) } //can afford this? - if( BG_Upgrade( upgrade )->price > (short)ent->client->ps.persistant[ PERS_CREDIT ] ) + if( BG_Upgrade( upgrade )->price > (short)ent->client->pers.credit ) { G_TriggerMenu( ent->client->ps.clientNum, MN_H_NOFUNDS ); return; @@ -2679,6 +2679,7 @@ void G_StopFollowing( gentity_t *ent ) 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; CalculateRanks( ); } diff --git a/src/game/g_team.c b/src/game/g_team.c index 5a2d5438..96e7e39e 100644 --- a/src/game/g_team.c +++ b/src/game/g_team.c @@ -143,12 +143,7 @@ void G_ChangeTeam( gentity_t *ent, team_t newTeam ) ent->client->pers.joinedATeam = qtrue; ent->client->pers.teamChangeTime = level.time; - if( oldTeam == TEAM_NONE ) - { - // Copy credits to ps for the client - ent->client->ps.persistant[ PERS_CREDIT ] = ent->client->pers.credit; - } - else if( oldTeam == TEAM_HUMANS && newTeam == TEAM_ALIENS ) + if( oldTeam == TEAM_HUMANS && newTeam == TEAM_ALIENS ) { // Convert from human to alien credits ent->client->pers.credit = @@ -163,6 +158,9 @@ void G_ChangeTeam( gentity_t *ent, team_t newTeam ) HUMAN_MAX_CREDITS / ALIEN_MAX_CREDITS + 0.5f ); } + // Copy credits to ps for the client + ent->client->ps.persistant[ PERS_CREDIT ] = ent->client->pers.credit; + ClientUserinfoChanged( ent->client->ps.clientNum ); if( oldTeam != TEAM_NONE && newTeam != TEAM_NONE ) |