Allowed the chaining of the on_event function

This commit is contained in:
Unknown
2017-12-15 16:54:43 +00:00
parent d8471f824f
commit 3ca2726ff9
2 changed files with 9 additions and 10 deletions

View File

@@ -220,16 +220,15 @@ function Ranking._rank:print(rtn,colour)
end
else
-- using threads to make less lag
local thread = Server.new_thread{data={rank=self,rtn=rtn}}
thread:on_event('resolve',function(thread)
Server.new_thread{
data={rank=self,rtn=rtn}
}:on_event('resolve',function(thread)
return thread.data.rank:get_players(true)
end)
thread:on_event('success',function(thread,players)
end):on_event('success',function(thread,players)
for _,player in pairs(players) do
player_return(thread.data.rtn,colour,player)
end
end)
thread:queue()
end):queue()
end
end