diff options
Diffstat (limited to 'src/game/g_cmds.c')
-rw-r--r-- | src/game/g_cmds.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index 9246a644..1b67ddaf 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -1875,8 +1875,10 @@ void Cmd_Class_f( gentity_t *ent ) } cost = BG_ClassCanEvolveFromTo( currentClass, newClass, - ent->client->pers.credit, + g_freeStuff.integer ? ALIEN_MAX_CREDITS : ent->client->pers.credit, g_alienStage.integer, 0 ); + if( g_freeStuff.integer && cost > 0 ) + cost = 0; if( G_RoomForClassChange( ent, newClass, infestOrigin ) ) { @@ -2212,7 +2214,7 @@ void Cmd_Buy_f( gentity_t *ent ) } //can afford this? - if( BG_Weapon( weapon )->price > (short)ent->client->pers.credit ) + if( BG_Weapon( weapon )->price > (short)ent->client->pers.credit && !g_freeStuff.integer ) { G_TriggerMenu( ent->client->ps.clientNum, MN_H_NOFUNDS ); return; @@ -2243,7 +2245,8 @@ void Cmd_Buy_f( gentity_t *ent ) ent->client->ps.stats[ STAT_MISC ] = 0; //subtract from funds - G_AddCreditToClient( ent->client, -(short)BG_Weapon( weapon )->price, qfalse ); + if( !g_freeStuff.integer ) + G_AddCreditToClient( ent->client, -(short)BG_Weapon( weapon )->price, qfalse ); } else if( upgrade != UP_NONE ) { @@ -2255,7 +2258,8 @@ void Cmd_Buy_f( gentity_t *ent ) } //can afford this? - if( BG_Upgrade( upgrade )->price > (short)ent->client->pers.credit ) + if( BG_Upgrade( upgrade )->price > (short)ent->client->pers.credit && + ( !g_freeStuff.integer || upgrade == UP_GRENADE ) ) { G_TriggerMenu( ent->client->ps.clientNum, MN_H_NOFUNDS ); return; @@ -2316,7 +2320,8 @@ void Cmd_Buy_f( gentity_t *ent ) G_GiveClientMaxAmmo( ent, qtrue ); //subtract from funds - G_AddCreditToClient( ent->client, -(short)BG_Upgrade( upgrade )->price, qfalse ); + if( !g_freeStuff.integer || upgrade == UP_GRENADE ) + G_AddCreditToClient( ent->client, -(short)BG_Upgrade( upgrade )->price, qfalse ); } else { @@ -2387,7 +2392,8 @@ void Cmd_Sell_f( gentity_t *ent ) ent->client->ps.stats[ STAT_BUILDABLE ] = BA_NONE; //add to funds - G_AddCreditToClient( ent->client, (short)BG_Weapon( weapon )->price, qfalse ); + if( !g_freeStuff.integer ) + G_AddCreditToClient( ent->client, (short)BG_Weapon( weapon )->price, qfalse ); } //if we have this weapon selected, force a new selection @@ -2428,7 +2434,8 @@ void Cmd_Sell_f( gentity_t *ent ) G_GiveClientMaxAmmo( ent, qtrue ); //add to funds - G_AddCreditToClient( ent->client, (short)BG_Upgrade( upgrade )->price, qfalse ); + if( !g_freeStuff.integer || upgrade == UP_GRENADE ) + G_AddCreditToClient( ent->client, (short)BG_Upgrade( upgrade )->price, qfalse ); } } else if( !Q_stricmp( s, "upgrades" ) ) @@ -2462,7 +2469,8 @@ void Cmd_Sell_f( gentity_t *ent ) G_GiveClientMaxAmmo( ent, qtrue ); //add to funds - G_AddCreditToClient( ent->client, (short)BG_Upgrade( i )->price, qfalse ); + if( !g_freeStuff.integer || i == UP_GRENADE ) + G_AddCreditToClient( ent->client, (short)BG_Upgrade( i )->price, qfalse ); } } } |