Skip to content

Commit

Permalink
Calculate num of patrol chains only once
Browse files Browse the repository at this point in the history
  • Loading branch information
speed2CZ authored and aeoncleanse committed Jun 19, 2017
1 parent be3b44f commit 4ab76e0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lua/ScenarioPlatoonAI.lua
Original file line number Diff line number Diff line change
Expand Up @@ -588,8 +588,9 @@ function SplitPatrolThread(platoon)
platoon:Stop()
if data then
if data.PatrolChains then
local num = table.getn(data.PatrolChains)
for _, v in platoon:GetPlatoonUnits() do
local chain = Random(1, table.getn(data.PatrolChains))
local chain = Random(1, num)
ScenarioFramework.GroupPatrolChain({v}, data.PatrolChains[chain])
end
else
Expand Down

0 comments on commit 4ab76e0

Please sign in to comment.