Skip to content

Commit 41db721

Browse files
committed
wip
1 parent d9ed17c commit 41db721

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

scripts/pathfinder/ReedsShepp.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,12 @@ function ReedsShepp.ActionSet:addAction(steer, gear, length)
138138
end
139139

140140
function ReedsShepp.ActionSet:calculateCost(unit, reverseCostMultiplier, gearSwitchCost)
141-
if reverseCostMultiplier == 1 and gearSwitchCost == 0 then return self.Length * unit end
142-
if self.Length == math.huge or #self.ctions == 0 then return math.huge end
141+
if reverseCostMultiplier == 1 and gearSwitchCost == 0 then return self.length * unit end
142+
if self.length == math.huge or #self.actions == 0 then return math.huge end
143143
local cost = 0
144144
local prevGear = self.actions[1].gear
145145
for _, a in ipairs(self.actions) do
146-
local actionCost = a.Length * unit
146+
local actionCost = a.length * unit
147147
if a.gear == Gear.Backward then
148148
actionCost = actionCost * reverseCostMultiplier
149149
end

0 commit comments

Comments
 (0)