From adc1c62a5af178825d5c275f53ed0836f0836078 Mon Sep 17 00:00:00 2001 From: sumneko Date: Tue, 9 Apr 2019 19:14:48 +0800 Subject: =?UTF-8?q?=E9=9D=9E=20Lua=205.3=20=E6=88=96=20Lua=205.4=20?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E5=B0=86=20integer=20=E9=80=80=E5=8C=96?= =?UTF-8?q?=E4=B8=BA=20number?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/src/vm/value.lua | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'server/src/vm/value.lua') diff --git a/server/src/vm/value.lua b/server/src/vm/value.lua index 625066b1..48b74bee 100644 --- a/server/src/vm/value.lua +++ b/server/src/vm/value.lua @@ -1,6 +1,7 @@ local libraryBuilder = require 'vm.library' local library = require 'core.library' local listMgr = require 'vm.list' +local config = require 'config' local Sort = 0 local Watch = setmetatable({}, {__mode = 'kv'}) @@ -79,6 +80,12 @@ function mt:setType(tp, rate) if tp == 'any' or tp == 'nil' then rate = 0.0 end + if tp == 'integer' then + local version = config.config.runtime.version + if version ~= 'Lua 5.3' and version ~= 'Lua 5.4' then + tp = 'number' + end + end local current = self._type[tp] or 0.0 self._type[tp] = current + (1 - current) * rate end -- cgit v1.2.3