Skip to content

Commit 0066d34

Browse files
committed
Added doc
1 parent 997325a commit 0066d34

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

scripts/ai/util/AIUtil.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,8 @@ end
707707

708708
function AIUtil.getWidth(vehicle)
709709
if vehicle.getAIAgentSize then
710+
--- Due to invalid implement ai comfigurations this function call might break the save ...
711+
--- So we try it and except the callstack, as every good vehicle/implement should cause this function to fail ..
710712
local valid, width = CpUtil.try(vehicle.getAIAgentSize, vehicle)
711713
if not valid then
712714
return vehicle.size.width
@@ -719,6 +721,8 @@ end
719721

720722
function AIUtil.getLength(vehicle)
721723
if vehicle.getAIAgentSize then
724+
--- Due to invalid implement ai comfigurations these function calls might break the save ...
725+
--- So we try it and except the callstack, as every good vehicle/implement should cause this function to fail ..
722726
local valid = CpUtil.try(vehicle.updateAIAgentAttachments, vehicle)
723727
if not valid then
724728
return vehicle.size.length

0 commit comments

Comments
 (0)