summaryrefslogtreecommitdiff
path: root/src/game/g_admin.c
diff options
context:
space:
mode:
authorTheriaca <reichmeister@protonmail.com>2019-01-26 07:19:44 +0100
committerPaweł Redman <pawel.redman@gmail.com>2019-02-10 14:47:47 +0100
commitb4f7bd74f46219909dcb116d4448a378edc405b7 (patch)
tree24a354b1d42671cb0d64214f367ab387d05a20d8 /src/game/g_admin.c
parentf70201598451e80e635c28a4eca198092211e399 (diff)
rewrite and optimize G_OverflowCredits()
- now always prioritizes poor players - synchronizes PERS_CREDIT once per loop, instead of constantly additionally, rename: - G_AddCreditToClient -> G_AddFundsToClient - G_OverflowCredits -> G_OverflowFunds - 'credit(s)' parameters -> 'funds'
Diffstat (limited to 'src/game/g_admin.c')
-rw-r--r--src/game/g_admin.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/game/g_admin.c b/src/game/g_admin.c
index cb42e31..9a331fe 100644
--- a/src/game/g_admin.c
+++ b/src/game/g_admin.c
@@ -5431,14 +5431,14 @@ qboolean G_admin_denyweapon( gentity_t *ent, int skiparg )
BG_InventoryContainsUpgrade( UP_GRENADE, vic->client->ps.stats ) )
{
BG_RemoveUpgradeFromInventory( UP_GRENADE, vic->client->ps.stats );
- G_AddCreditToClient( vic->client, (short)BG_FindPriceForUpgrade( UP_GRENADE ), qfalse );
+ G_AddFundsToClient( vic->client, (short)BG_FindPriceForUpgrade( UP_GRENADE ), qfalse );
}
if( BG_InventoryContainsWeapon( weapon, vic->client->ps.stats ) )
{
int maxAmmo, maxClips;
BG_RemoveWeaponFromInventory( weapon, vic->client->ps.stats );
- G_AddCreditToClient( vic->client, (short)BG_FindPriceForWeapon( weapon ), qfalse );
+ G_AddFundsToClient( vic->client, (short)BG_FindPriceForWeapon( weapon ), qfalse );
BG_AddWeaponToInventory( WP_MACHINEGUN, vic->client->ps.stats );
BG_FindAmmoForWeapon( WP_MACHINEGUN, &maxAmmo, &maxClips );
@@ -5490,7 +5490,7 @@ qboolean G_admin_denyweapon( gentity_t *ent, int skiparg )
vic->client->pers.classSelection = PCL_ALIEN_LEVEL0;
cost = BG_ClassCanEvolveFromTo( PCL_ALIEN_LEVEL0, class, 9, 0 );
if( cost < 0 ) cost = 0;
- G_AddCreditToClient( vic->client, cost, qfalse );
+ G_AddFundsToClient( vic->client, cost, qfalse );
ClientUserinfoChanged( pids[ 0 ], qfalse );
VectorCopy( infestOrigin, vic->s.pos.trBase );
ClientSpawn( vic, vic, vic->s.pos.trBase, vic->s.apos.trBase );
@@ -10556,7 +10556,7 @@ qboolean G_admin_give(gentity_t *ent, int skiparg)
goto invalid_target;
}
- G_AddCreditToClient(target->client, amount, qtrue);
+ G_AddFundsToClient(target->client, amount, qtrue);
AP(va("print \"^3!give: ^7%s^7 was given %i %s%s by ^7%s^7\n\"",
target->client->pers.netname, amount, currency,
(abs(amount) != 1 ? "s" : ""),