performance improvements

This commit is contained in:
Manuel Simon Hirsig
2016-11-06 21:07:24 +01:00
parent 88e036fe50
commit 732346a118
11 changed files with 148 additions and 159 deletions
+14 -4
View File
@@ -122,10 +122,15 @@ do
PlaceAuctionBid(type, index, amount)
if money >= amount then
locked = true
local send_signal, signal_received = signal()
thread(when, signal_received, function()
do (on_success or nop)() end
locked = false
end)
thread(when, later(GetTime(), 5), send_signal)
event_listener('CHAT_MSG_SYSTEM', function(kill)
if arg1 == ERR_AUCTION_BID_PLACED then
do (on_success or nop)() end
locked = false
send_signal()
kill()
end
end)
@@ -140,10 +145,15 @@ do
if locked then return end
locked = true
CancelAuction(index)
local send_signal, signal_received = signal()
thread(when, signal_received, function()
do (on_success or nop)() end
locked = false
end)
thread(when, later(GetTime(), 5), send_signal)
event_listener('CHAT_MSG_SYSTEM', function(kill)
if arg1 == ERR_AUCTION_REMOVED then
do (on_success or nop)() end
locked = false
send_signal()
kill()
end
end)