From 70144bcabe5185051594292181d6827ab9ae278c Mon Sep 17 00:00:00 2001 From: IronClawTrem Date: Sun, 1 Mar 2020 16:51:00 +0000 Subject: make !showff return a value --- src/game/g_admin.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/game/g_admin.c b/src/game/g_admin.c index 8817432..444cff6 100644 --- a/src/game/g_admin.c +++ b/src/game/g_admin.c @@ -8045,15 +8045,19 @@ qboolean G_admin_versions(gentity_t *ent, int skiparg) return qtrue; } -static int calc_ff_pct(statsCounters_t *sc) { - if (sc->dmgdone + sc->structdmgdone <= 0) { - if (sc->ffdmgdone <= 0) +static int calc_ff_pct( statsCounters_t *sc ) +{ + if ( sc->dmgdone + sc->structdmgdone <= 0 ) + { + if ( sc->ffdmgdone <= 0 ) return 0; else return 100; - } // else { - // return round((float)sc->ffdmgdone / (sc->ffdmgdone + sc->dmgdone + sc->structdmgdone) * 100); - // } + } + else + { + return round((float)sc->ffdmgdone / (sc->ffdmgdone + sc->dmgdone + sc->structdmgdone) * 100); + } } qboolean G_admin_showff(gentity_t *ent, int skiparg) -- cgit