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

fixing passScanning not checking for enemy structures

This commit is contained in:
Aaron Veden 2021-12-14 19:12:22 -08:00
parent 70327b2eb1
commit cdfef6f83e
No known key found for this signature in database
GPG Key ID: FF5990B1C6DD3F84
4 changed files with 20 additions and 7 deletions

View File

@ -213,6 +213,15 @@ local function addCommandSet(queriesAndCommands)
"simple-entity"
}
}
queriesAndCommands.cpsFilteredEnemyAnyFound = {
area=cpsSharedChunkArea,
force=queriesAndCommands.enemyForces,
type={
"turret",
"unit-spawner"
},
limit = 1
}
-- msrc
local msrcSharedChunkArea = {
@ -468,7 +477,6 @@ function upgrade.attempt(universe)
if global.version < 204 then
global.version = 204
addCommandSet(universe)
universe.eventId = 0
universe.chunkId = 0
universe.randomGenerator = nil
@ -509,8 +517,12 @@ function upgrade.attempt(universe)
universe.chunkToPassScanIterator = nil
universe.baseId = 0
universe.awake = false
end
if global.version < 205 then
global.version = 205
game.print("Rampant - Version 2.0.0")
addCommandSet(universe)
game.print("Rampant - Version 2.0.1")
end
return (starting ~= global.version) and global.version

View File

@ -3,6 +3,8 @@ Version: 2.0.1
Date: 23. 11. 2021
Contributions:
- RealSimplyData fixed missing map parameter in onUnitGroupCreated (Thanks illiander42 for reporting)
Bugfixes:
- Fixed chunkPassScanning not checking for enemy structures when determining passability
---------------------------------------------------------------------------------------------------
Version: 2.0.0

View File

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

View File

@ -276,8 +276,9 @@ function chunkUtils.chunkPassScan(chunk, map)
local universe = map.universe
setAreaInQueryChunkSize(universe.cpsFilteredTilesQuery, chunk)
local waterTiles = (1 - (surface.count_tiles_filtered(universe.cpsFilteredTilesQuery) * 0.0009765625)) * 0.80
local enemyCount = surface.count_entities_filtered(universe.cpsFilteredEnemyAnyFound)
if (waterTiles >= CHUNK_PASS_THRESHOLD) then
if (waterTiles >= CHUNK_PASS_THRESHOLD) or (enemyCount > 0) then
local neutralObjects = mMax(0,
mMin(1 - (surface.count_entities_filtered(universe.cpsFilteredEntitiesChunkNeutral) * 0.005),
1) * 0.20)
@ -285,9 +286,7 @@ function chunkUtils.chunkPassScan(chunk, map)
local playerObjects = getPlayerBaseGenerator(map, chunk)
local nests = getNestCount(map, chunk)
if ((playerObjects > 0) or (nests > 0)) and (pass == CHUNK_IMPASSABLE) then
if ((playerObjects > 0) or (enemyCount > 0)) and (pass == CHUNK_IMPASSABLE) then
pass = CHUNK_ALL_DIRECTIONS
end