Working MP
This commit is contained in:
@@ -88,13 +88,16 @@ function TowBarMod.Utils.updateAttachmentsForRigidTow(towingVehicle, towedVehicl
|
||||
towedAttachment:setUpdateConstraint(false)
|
||||
towedAttachment:setZOffset(0)
|
||||
|
||||
local offset = towedAttachment:getOffset()
|
||||
local zShift = offset:z() > 0 and 1 or -1
|
||||
towedAttachment:getOffset():set(offset:x(), offset:y(), offset:z() + zShift)
|
||||
local towedModData = towedVehicle:getModData()
|
||||
towedModData["isChangedTowedAttachment"] = true
|
||||
towedModData["towBarChangedAttachmentId"] = attachmentB
|
||||
towedModData["towBarChangedOffsetZShift"] = zShift
|
||||
local alreadyShifted = towedModData["isChangedTowedAttachment"] and towedModData["towBarChangedAttachmentId"] == attachmentB
|
||||
if not alreadyShifted then
|
||||
local offset = towedAttachment:getOffset()
|
||||
local zShift = offset:z() > 0 and 1 or -1
|
||||
towedAttachment:getOffset():set(offset:x(), offset:y(), offset:z() + zShift)
|
||||
towedModData["isChangedTowedAttachment"] = true
|
||||
towedModData["towBarChangedAttachmentId"] = attachmentB
|
||||
towedModData["towBarChangedOffsetZShift"] = zShift
|
||||
end
|
||||
towedVehicle:transmitModData()
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user