1
0
mirror of https://github.com/veden/Rampant.git synced 2024-12-30 21:19:46 +02:00

fix for repeated attacks on same chunk

This commit is contained in:
veden 2016-09-14 11:00:34 -07:00
parent 31a3c6213f
commit 5638f947d5

View File

@ -37,6 +37,7 @@ local findNearBySquad = unitGroupUtils.findNearBySquad
local createSquad = unitGroupUtils.createSquad
local membersToSquad = unitGroupUtils.membersToSquad
local scoreNeighborsWithDirection = neighborUtils.scoreNeighborsWithDirection
local addSquadMovementPenalty = unitGroupUtils.addSquadMovementPenalty
-- module code
@ -97,10 +98,12 @@ function aiDefense.retreatUnits(position, squad, regionMap, surface, natives)
membersToSquad(newSquad, enemiesToSquad, false)
else
membersToSquad(newSquad, squad.group.members, true)
newSquad.penalties = squad.penalties
if squad.rabid then
newSquad.rabid = true
end
end
addSquadMovementPenalty(newSquad, chunk.cX, chunk.cY)
end
end
end