summaryrefslogtreecommitdiff
path: root/src/game/g_client.c
diff options
context:
space:
mode:
authorPaweł Redman <pawel.redman@gmail.com>2019-02-10 17:57:53 +0100
committerPaweł Redman <pawel.redman@gmail.com>2019-02-10 17:57:53 +0100
commitc2f8ef14e564125d141c4341a4a1863bacb21be9 (patch)
treeb061aef0ff9f4a1d6c1ca910e30d8143775db808 /src/game/g_client.c
parent7cf6bb398cf895ecc9a436dcec6525920a0ea551 (diff)
Fractional sharing and donating
Diffstat (limited to 'src/game/g_client.c')
-rw-r--r--src/game/g_client.c15
1 files changed, 15 insertions, 0 deletions
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);