summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIronClawTrem <louie.nutman@gmail.com>2020-03-03 14:09:07 +0000
committerIronClawTrem <louie.nutman@gmail.com>2020-03-03 15:55:29 +0000
commit14027880b4b7156dca2400f7cc56bf27b82fc293 (patch)
treebe9ca3b074ef13fadb36700908d2b0661a1d182a
parent47b7ec756a81b3fecd67ae0ebb52921f2debfcd5 (diff)
make working !showff round function for QVM support
-rw-r--r--src/game/g_admin.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/game/g_admin.c b/src/game/g_admin.c
index 6280ada..db8b3b4 100644
--- a/src/game/g_admin.c
+++ b/src/game/g_admin.c
@@ -7855,15 +7855,19 @@ qboolean G_admin_versions(gentity_t *ent, int skiparg)
return qtrue;
}
+int ffpercentage( float fffloat ) {
+ return fffloat < 0 ? fffloat - 0.5 : fffloat + 0.5;
+}
+
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)