1
0
mirror of https://github.com/veden/Rampant.git synced 2024-12-26 20:54:12 +02:00

FACTO-288: Added squad creation pathing check

This commit is contained in:
Aaron Veden 2023-04-05 17:41:33 -07:00
parent 3f7d47814c
commit d6d3811952
No known key found for this signature in database
GPG Key ID: FF5990B1C6DD3F84
2 changed files with 6 additions and 3 deletions

View File

@ -9,6 +9,7 @@ Version: 3.3.0
- Fixed squad compression could take place when attacking
- Fixed squad command timeout duration to account for 4 chunk pathing finding
- Fixed death pheromone could zero out a chunk for squad movement planning
- Fixed squad creation didn't take into account chunk pathing from nest to squad
---------------------------------------------------------------------------------------------------
Version: 3.2.2

View File

@ -1080,8 +1080,7 @@ local function scoreUnitGroupLocation(neighborChunk)
end
local function validUnitGroupLocation(neighborChunk)
return (getPassable(neighborChunk) == CHUNK_ALL_DIRECTIONS) and
(not neighborChunk.nestCount)
return (not neighborChunk.nestCount)
end
local function visitPattern(o, cX, cY, distance)
@ -1133,7 +1132,10 @@ local function scoreNeighborsForFormation(chunk, validFunction, scoreFunction)
local neighborChunks = getNeighborChunks(chunk.map, chunk.x, chunk.y)
for x=1,8 do
local neighborChunk = neighborChunks[x]
if (neighborChunk ~= -1) and validFunction(neighborChunk) then
if (neighborChunk ~= -1)
and canMoveChunkDirection(x, chunk, neighborChunk)
and validFunction(neighborChunk)
then
local score = scoreFunction(neighborChunk)
if (score > highestScore) then
highestScore = score