Skip to content

Commit 324e0ae

Browse files
committed
Add missing event for detaching on vehicle explosion
1 parent b17e53e commit 324e0ae

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

[gameplay]/glue_new/logic/SVehicleAttach.lua

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,13 @@ local function detachElementsOnVehicleDestroy()
162162
end
163163
addEventHandler("onElementDestroy", root, detachElementsOnVehicleDestroy)
164164

165+
local function detachElementsOnVehicleExplode()
166+
detachAttachedVehicleElements(source)
167+
end
168+
if (GLUE_DETACH_ON_VEHICLE_EXPLOSION) then
169+
addEventHandler("onVehicleExplode", root, detachElementsOnVehicleExplode)
170+
end
171+
165172
local function detachElementsOnResourceStop()
166173
local vehiclesTable = getElementsByType("vehicle")
167174

0 commit comments

Comments
 (0)