Skip to content
This repository has been archived by the owner on Nov 13, 2024. It is now read-only.

Commit

Permalink
support idents in detach (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanctech committed Jul 28, 2021
1 parent a8ce6c7 commit a851a73
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions sonorancad/core/httpd.lua
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,25 @@ local PushEventHandler = {
else
debugLog("Detach failure, unknown call or unit")
end
elseif body.data.idents ~= nil then
for i=1, #body.data.idents do
local unit = GetUnitCache()[body.data.idents[i]]
if call and unit then
TriggerEvent('SonoranCAD::pushevents:UnitDetach', call, unit)
local idx = nil
for i, u in pairs(call.units) do
if u.id == unit.id then
idx = i
end
end
if idx ~= nil then
table.remove(call.units, idx)
SetCallCache(body.data.callId, { dispatch_type = "CALL_EDIT", dispatch = call })
end
else
debugLog("Detach failure, unknown call or unit")
end
end
end
end,
GET_LOGS = function(body)
Expand Down

0 comments on commit a851a73

Please sign in to comment.