diff options
author | Jesusaves <cpntb1@ymail.com> | 2024-07-11 11:30:38 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2024-07-11 11:30:38 -0300 |
commit | 04d26c36533e03ac5cb76e93940e861aed5a4e19 (patch) | |
tree | 9422830b6aa25f062d3a345ccd3d3d9347514529 | |
parent | 910860e02d1eeec3b41a74ff0ce2bfe6d7a35f77 (diff) | |
download | serverdata-04d26c36533e03ac5cb76e93940e861aed5a4e19.tar.gz serverdata-04d26c36533e03ac5cb76e93940e861aed5a4e19.tar.bz2 serverdata-04d26c36533e03ac5cb76e93940e861aed5a4e19.tar.xz serverdata-04d26c36533e03ac5cb76e93940e861aed5a4e19.zip |
A rogue min function test fix
-rw-r--r-- | npc/functions/clientversion.txt | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/npc/functions/clientversion.txt b/npc/functions/clientversion.txt index 9b9161250..4d25fb608 100644 --- a/npc/functions/clientversion.txt +++ b/npc/functions/clientversion.txt @@ -23,15 +23,17 @@ function script clientupdater { .@v3=getstatus(SC_JAILED, 3); .@v4=getstatus(SC_JAILED, 4); .@ti=getstatus(SC_JAILED, 5); - consolebug("Please reduce sentence from %d to %d (in %d)", .@v1, min(1, .@v1-##HARDCORE_JAILTIME+1), (##HARDCORE_JAILTIME-1)); - .@v1 = min(1, .@v1-##HARDCORE_JAILTIME+1); + consolebug("Please reduce sentence from %d to %d (in %d)", .@v1, max(1, .@v1-##HARDCORE_JAILTIME+1), (##HARDCORE_JAILTIME-1)); + .@v1 = max(1, .@v1-##HARDCORE_JAILTIME+1); if (.@ti > 60000) - .@ti = min(60000, .@ti - ((##HARDCORE_JAILTIME+1) * 60000)); + .@ti = max(60000, .@ti - ((##HARDCORE_JAILTIME+1) * 60000)); //sc_end SC_JAILED; - //sc_start4 SC_JAILED, .@ti, .@v1, .@v2, .@v3, .@v4, 10000, SCFLAG_FIXEDRATE|SCFLAG_FIXEDTICK|SCFLAG_NOAVOID; - //dispbottom l("Information: Your sentence was reduced in %d minute(s).", (##HARDCORE_JAILTIME-1)); + sc_start4 SC_JAILED, .@ti, .@v1, .@v2, .@v3, .@v4, 10000, SCFLAG_FIXEDRATE|SCFLAG_FIXEDTICK|SCFLAG_NOAVOID; + dispbottom l("Information: Your sentence was reduced in %d minute(s). Sentence left: %s", (##HARDCORE_JAILTIME-1), FuzzyTime(gettimetick(2)+.@v1)); + ##HARDCORE_JAILTIME=-1; // Ensure cleanup, should be overriden soon + } else { + dispbottom l("You will revive automatically. Use %s to see remaining jail time.", b("@jailtime")); } - dispbottom l("You will revive automatically. Use %s to see remaining jail time.", b("@jailtime")); ##HARDCORE_JAILTIME=1; } // If you're in Jail on HardCore and this is Beta Server |