Skip to content

Commit 8366f25

Browse files
committed
Update SVehicleAttachSync.lua
1 parent 0d41fdb commit 8366f25

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

[gameplay]/glue_new/logic/SVehicleAttachSync.lua

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,20 @@ local function correctAttachedPlayersPosition()
2626
local attachVehiclePosition = attachVehiclesPosition[attachedToVehicle]
2727

2828
if (not attachVehiclePosition) then
29-
local attachVehicleX, attachVehicleY, attachVehicleZ = getElementPosition(attachedToVehicle)
29+
local attachVehiclePosX, attachVehiclePosY, attachVehiclePosZ = getElementPosition(attachedToVehicle)
3030
local attachVehiclePositionData = {
31-
attachVehicleX,
32-
attachVehicleY,
33-
attachVehicleZ,
31+
attachVehiclePosX,
32+
attachVehiclePosY,
33+
attachVehiclePosZ,
3434
}
3535

3636
attachVehiclesPosition[attachedToVehicle] = attachVehiclePositionData
37-
else
38-
local attachPosX, attachPosY, attachPosZ = attachVehiclePosition[1], attachVehiclePosition[2], attachVehiclePosition[3]
39-
40-
setElementPosition(attachedPlayer, attachPosX, attachPosY, attachPosZ, attachPositionWarp)
37+
attachVehiclePosition = attachVehiclesPosition[attachedToVehicle]
4138
end
39+
40+
local attachPosX, attachPosY, attachPosZ = attachVehiclePosition[1], attachVehiclePosition[2], attachVehiclePosition[3]
41+
42+
setElementPosition(attachedPlayer, attachPosX, attachPosY, attachPosZ, attachPositionWarp)
4243
else
4344
attachSyncCorrection[attachedPlayer] = nil
4445
end

0 commit comments

Comments
 (0)