From 993cb1442abc9e8b09655d1ce7d9df62198797e0 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Sat, 22 Dec 2018 18:39:52 -0200 Subject: Fix log2() formula and fix Christmas gifts for reward count. There was a misplaced 1, and an edge case was not handled previously (gifts=0). --- npc/functions/math.txt | 2 ++ 1 file changed, 2 insertions(+) (limited to 'npc/functions/math.txt') diff --git a/npc/functions/math.txt b/npc/functions/math.txt index 3c2c935d9..ebb9ee069 100644 --- a/npc/functions/math.txt +++ b/npc/functions/math.txt @@ -46,6 +46,8 @@ function script log2 { .@v=abs(getarg(0)); .@ok=0; .@i=0; + if (.@v < 1) + return -1; freeloop(true); while (!.@ok) { -- cgit v1.2.3-60-g2f50