Skip to content

Commit 177a102

Browse files
committed
Might fix #138
#138
1 parent 058c53d commit 177a102

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

scripts/ai/util/AIUtil.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,10 @@ end
716716

717717
function AIUtil.getLength(vehicle)
718718
if vehicle.getAIAgentSize then
719-
vehicle:updateAIAgentAttachments()
719+
local valid = CpUtil.try(vehicle.updateAIAgentAttachments, vehicle)
720+
if not valid then
721+
return vehicle.size.length
722+
end
720723
local width, length, lengthOffset, frontOffset, height = vehicle:getAIAgentSize()
721724
for _, attachment in ipairs(vehicle.spec_aiDrivable.attachments) do
722725
length = length + attachment.length

0 commit comments

Comments
 (0)