1
0
mirror of https://github.com/veden/Rampant.git synced 2025-03-17 20:58:35 +02:00

FACTO-118: Player check to settle move

This commit is contained in:
Aaron Veden 2022-04-24 12:18:29 -07:00
parent 9b081cbfb1
commit bc8dd03b3c
No known key found for this signature in database
GPG Key ID: FF5990B1C6DD3F84
3 changed files with 10 additions and 5 deletions

View File

@ -1,3 +1,8 @@
---------------------------------------------------------------------------------------------------
Version: 3.0.3
Bugfixes:
- Fixed settling squads not detecting players on a chunk when deciding to settle early
---------------------------------------------------------------------------------------------------
Version: 3.0.2
Bugfixes:

View File

@ -1,7 +1,7 @@
{
"name" : "Rampant",
"factorio_version" : "1.1",
"version" : "3.0.2",
"version" : "3.0.3",
"title" : "Rampant",
"author" : "Veden",
"homepage" : "https://forums.factorio.com/viewtopic.php?f=94&t=31445",

View File

@ -65,7 +65,7 @@ local removeSquadFromChunk = chunkPropertyUtils.removeSquadFromChunk
local addDeathGenerator = chunkPropertyUtils.addDeathGenerator
local getDeathGeneratorRating = chunkPropertyUtils.getDeathGeneratorRating
local getPlayersOnChunk = chunkPropertyUtils.getPlayersOnChunk
local getHiveCount = chunkPropertyUtils.getHiveCount
local getNestCount = chunkPropertyUtils.getNestCount
@ -201,7 +201,8 @@ local function settleMove(map, squad)
local attackPlayerThreshold = universe.attackPlayerThreshold
if (nextAttackChunk ~= -1) then
if (getPlayerBaseGenerator(map,nextAttackChunk) == 0) or (squad.type ~= BASE_AI_STATE_SIEGE) then
if (getPlayerBaseGenerator(map, nextAttackChunk) == 0) and (getPlayersOnChunk(map, nextAttackChunk) == 0)
then
attackChunk = nextAttackChunk
position = findMovementPosition(
surface,
@ -241,8 +242,7 @@ local function settleMove(map, squad)
end
if (nextAttackChunk ~= -1) and
(squad.type == BASE_AI_STATE_SIEGE) and
(getPlayerBaseGenerator(map, nextAttackChunk) ~= 0)
((getPlayerBaseGenerator(map, nextAttackChunk) ~= 0) or (getPlayersOnChunk(map, nextAttackChunk) ~= 0))
then
cmd = universe.settleCommand
squad.status = SQUAD_BUILDING