From 3bd61890073f9ff69b214e84843c71be94890edc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Thu, 21 Nov 2019 21:02:19 +0800 Subject: =?UTF-8?q?=E6=A3=80=E6=9F=A5class?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server-beta/src/vm/eachField.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'server-beta/src/vm/eachField.lua') diff --git a/server-beta/src/vm/eachField.lua b/server-beta/src/vm/eachField.lua index 549a7dec..1d3d222d 100644 --- a/server-beta/src/vm/eachField.lua +++ b/server-beta/src/vm/eachField.lua @@ -133,7 +133,10 @@ function vm.eachField(source, callback) local cache = vm.cache.eachField[source] if cache then for i = 1, #cache do - callback(cache[i]) + local res = callback(cache[i]) + if res ~= nil then + return res + end end return end @@ -158,6 +161,9 @@ function vm.eachField(source, callback) vm.cache.eachField[src] = cache end) for i = 1, #cache do - callback(cache[i]) + local res = callback(cache[i]) + if res ~= nil then + return res + end end end -- cgit v1.2.3