From c2f8ef14e564125d141c4341a4a1863bacb21be9 Mon Sep 17 00:00:00 2001 From: Paweł Redman Date: Sun, 10 Feb 2019 17:57:53 +0100 Subject: Fractional sharing and donating --- src/game/g_client.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/game/g_client.c') diff --git a/src/game/g_client.c b/src/game/g_client.c index b8b4968..02b827f 100644 --- a/src/game/g_client.c +++ b/src/game/g_client.c @@ -79,6 +79,21 @@ void SP_info_human_intermission( gentity_t *ent ) { } +/* +=============== +G_RoundFunds + +Credits are rounded to the nearest integer, evos to the nearest 100th. +=============== +*/ +float G_RoundFunds(float funds, pTeam_t team) +{ + if (team == PTE_ALIENS) + return roundf(funds * 100.0f) / 100.0f; + else + return roundf(funds); +} + static int compare_client_funds(const void *c1, const void *c2) { return (((const gclient_t *)c1)->pers.funds - ((const gclient_t *)c2)->pers.funds); -- cgit