From 06ce7a427011fc9d941d7028013a234d29a93c19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Wed, 30 Jan 2019 09:50:46 +0800 Subject: =?UTF-8?q?=E5=A4=9A=E6=AC=A1=E6=8E=A8=E6=96=AD=E7=9A=84=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=E5=8F=A0=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/src/core/value.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'server/src/core/value.lua') diff --git a/server/src/core/value.lua b/server/src/core/value.lua index a998d195..61882175 100644 --- a/server/src/core/value.lua +++ b/server/src/core/value.lua @@ -25,9 +25,8 @@ function mt:inference(tp, rate) if not self._type then self._type = {} end - if not self._type[tp] or rate > self._type[tp] then - self._type[tp] = rate - end + local current = self._type[tp] or 0.0 + self._type[tp] = current + (1 - current) * rate end function mt:getType() -- cgit v1.2.3