Skip to content

Commit

Permalink
removed recvbyte support
Browse files Browse the repository at this point in the history
  • Loading branch information
MillhioreBT committed Dec 15, 2021
1 parent 51a4cf7 commit 5b0fe65
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions data/scripts/lib/event_callbacks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,14 @@ EventCallback = {
eventData.maxn = #eventData +1
eventData[eventData.maxn] = {
callback = callback,
triggerIndex = tonumber(triggerIndex) or 0,
byte = rawget(self, "byte")
triggerIndex = tonumber(triggerIndex) or 0
}
table.sort(eventData, function (ecl, ecr) return ecl.triggerIndex < ecr.triggerIndex end)
self.eventType = nil
self.callback = nil
rawset(self, "byte", nil)
end
end,

recvbyte = function (self, recvbyte) rawset(self, "byte", recvbyte) end,
clear = function (self)
EventCallbackData = {}
for i = 1, EVENT_CALLBACK_LAST do
Expand Down Expand Up @@ -124,8 +121,6 @@ setmetatable(EventCallback, {
for index = 1, eventData.maxn do
local event = eventData[index]
repeat
-- The networks allow you to define a specific recvbyte
if info.network and event.byte and event.byte ~= args[2] then break end
results = {event.callback(unpack(args))}
local output = results[1]
-- If the call returns nil then we continue with the next call
Expand All @@ -137,8 +132,6 @@ setmetatable(EventCallback, {
-- We left the loop why have we reached the end
if index == eventData.maxn then return unpack(results) end
until true
-- We reset the position of the message so that the next call will treat it correctly
if info.network then args[3]:seek(1) end
-- Update the results for the next call
for index, value in pairs(updateableParameters[callback]) do
args[index] = results[value]
Expand Down

0 comments on commit 5b0fe65

Please sign in to comment.