From 216fc980dd8221198e491745a0eaa029c37f74d3 Mon Sep 17 00:00:00 2001 From: Mikko Tiusanen Date: Tue, 24 Mar 2015 22:07:07 +0200 Subject: Fixed issues with credit gain scaling and changed the scaling to be non linear. --- src/game/g_combat.c | 6 +++--- src/game/g_local.h | 1 + src/game/g_main.c | 2 ++ 3 files changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/game/g_combat.c b/src/game/g_combat.c index 966e595..eb7f48e 100644 --- a/src/game/g_combat.c +++ b/src/game/g_combat.c @@ -203,11 +203,11 @@ float G_RewardScaleFactor( gentity_t *self, gentity_t *target ) targetScore = level.alienRewardScore/level.humanRewardScore; break; default: - return 0; + return 0.0f; } if ( target->client != NULL ) { - if( self->client->ps.persistant[ PERS_SCORE ] <= 0 || target->client->ps.persistant[ PERS_SCORE ] <= 0) return targetScore; - targetScore *= target->client->ps.persistant[ PERS_SCORE ]/self->client->ps.persistant[ PERS_SCORE ]; + if( self->client->ps.persistant[ PERS_SCORE ] > 0 && target->client->ps.persistant[ PERS_SCORE ] > 0) + targetScore *= pow(target->client->ps.persistant[ PERS_SCORE ],g_RewardFactorPower.value)/pow(self->client->ps.persistant[ PERS_SCORE ],g_RewardFactorPower.value); } targetScore *= 1.0f-g_ConstantRewardFactor.value; targetScore += g_ConstantRewardFactor.value; diff --git a/src/game/g_local.h b/src/game/g_local.h index 9cc0ff2..30a61b0 100644 --- a/src/game/g_local.h +++ b/src/game/g_local.h @@ -1369,6 +1369,7 @@ extern vmCvar_t g_KillRewardMultiplierH; extern vmCvar_t g_ConstantRewardFactor; extern vmCvar_t g_MinRewardFactor; extern vmCvar_t g_MaxRewardFactor; +extern vmCvar_t g_RewardFactorPower; extern vmCvar_t g_ForceRandomTeams; extern vmCvar_t g_AutoLevelMinTeamSize; extern vmCvar_t g_RageQuitScorePenalty; diff --git a/src/game/g_main.c b/src/game/g_main.c index 2d0c788..d8003cc 100644 --- a/src/game/g_main.c +++ b/src/game/g_main.c @@ -193,6 +193,7 @@ vmCvar_t g_KillRewardMultiplierH; vmCvar_t g_ConstantRewardFactor; vmCvar_t g_MinRewardFactor; vmCvar_t g_MaxRewardFactor; +vmCvar_t g_RewardFactorPower; vmCvar_t g_TimerPeriod; vmCvar_t g_TimerCommand; vmCvar_t g_ForceRandomTeams; @@ -371,6 +372,7 @@ static cvarTable_t gameCvarTable[ ] = { &g_ConstantRewardFactor, "g_ConstantRewardFactor", "0", CVAR_ARCHIVE, 0, qfalse }, { &g_MinRewardFactor, "g_MinRewardFactor", "0.2", CVAR_ARCHIVE, 0, qfalse }, { &g_MaxRewardFactor, "g_MaxRewardFactor", "5.0", CVAR_ARCHIVE, 0, qfalse }, + { &g_RewardFactorPower, "g_RewardFactorPower", "0.3025", CVAR_ARCHIVE, 0, qfalse }, { &g_TimerPeriod, "g_TimerPeriod", "0", CVAR_ARCHIVE, 0, qfalse }, { &g_TimerCommand, "g_TimerCommand", "", CVAR_ARCHIVE, 0, qfalse }, { &g_ForceRandomTeams, "g_ForceRandomTeams", "0", CVAR_ARCHIVE, 0, qfalse }, -- cgit