mirror of
https://github.com/veden/Rampant.git
synced 2024-12-24 20:14:35 +02:00
FACTO-340: Fixed tile passability check using water-layer instead of player-layer
This commit is contained in:
parent
c5004f4fad
commit
db250cd1a6
@ -3,6 +3,7 @@ Version: 3.3.3
|
||||
Bugfixes:
|
||||
- Added check for invalid entity upgrade
|
||||
- Added wander command to squads if they timeout for executing a command to fix enemy units getting stuck
|
||||
- Changed tile algorithm to use player-layer instead of water-layer for determining if a chunk is passable
|
||||
|
||||
---------------------------------------------------------------------------------------------------
|
||||
Version: 3.3.2
|
||||
|
@ -188,6 +188,27 @@ function MapUtils.isExcludedSurface(surfaceName)
|
||||
sFind(surfaceName, "bpsb%-lab%-")
|
||||
end
|
||||
|
||||
function MapUtils.queueChunks(surface, chunks, flush, tick)
|
||||
for chunk in chunks do
|
||||
if surface.is_chunk_generated(chunk) then
|
||||
MapUtils.queueGeneratedChunk(
|
||||
{
|
||||
surface = surface,
|
||||
tick = tick,
|
||||
area = {
|
||||
left_top = {
|
||||
x = chunk.x * 32,
|
||||
y = chunk.y * 32
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
Universe.flushPendingChunks = flush
|
||||
end
|
||||
|
||||
function MapUtils.prepMap(surface)
|
||||
if Universe.maps[surface.index] then
|
||||
return Universe.maps[surface.index]
|
||||
@ -219,27 +240,10 @@ function MapUtils.prepMap(surface)
|
||||
}
|
||||
|
||||
Universe.maps[map.id] = map
|
||||
local tick = game.tick
|
||||
|
||||
-- queue all current chunks that wont be generated during play
|
||||
local tick = game.tick
|
||||
for chunk in surface.get_chunks() do
|
||||
if surface.is_chunk_generated(chunk) then
|
||||
MapUtils.queueGeneratedChunk(
|
||||
{
|
||||
surface = surface,
|
||||
tick = tick,
|
||||
area = {
|
||||
left_top = {
|
||||
x = chunk.x * 32,
|
||||
y = chunk.y * 32
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
Universe.flushPendingChunks = true
|
||||
MapUtils.queueChunks(surface, surface.get_chunks(), true, tick)
|
||||
|
||||
return map
|
||||
end
|
||||
|
@ -19,6 +19,7 @@ local Upgrade = {}
|
||||
-- imports
|
||||
|
||||
local Constants = require("libs/Constants")
|
||||
local MapUtils = require("libs/MapUtils")
|
||||
|
||||
--
|
||||
|
||||
@ -190,7 +191,7 @@ local function addCommandSet()
|
||||
{0,0}
|
||||
}
|
||||
Universe.isFilteredTilesQuery = {
|
||||
collision_mask="water-tile",
|
||||
collision_mask="player-layer",
|
||||
area=isSharedChunkArea
|
||||
}
|
||||
Universe.isFilteredEntitiesChunkNeutral = {
|
||||
@ -225,7 +226,7 @@ local function addCommandSet()
|
||||
{0,0}
|
||||
}
|
||||
Universe.cpsFilteredTilesQuery = {
|
||||
collision_mask="water-tile",
|
||||
collision_mask="player-layer",
|
||||
area=cpsSharedChunkArea
|
||||
}
|
||||
Universe.cpsFilteredEntitiesChunkNeutral = {
|
||||
@ -252,7 +253,7 @@ local function addCommandSet()
|
||||
{0,0}
|
||||
}
|
||||
Universe.msrcFilteredTilesQuery = {
|
||||
collision_mask="water-tile",
|
||||
collision_mask="player-layer",
|
||||
area=msrcSharedChunkArea
|
||||
}
|
||||
Universe.msrcFilteredEntitiesChunkNeutral = {
|
||||
@ -280,7 +281,7 @@ local function addCommandSet()
|
||||
}
|
||||
Universe.spFilteredTilesPathQuery = {
|
||||
area=spSharedAreaChunk,
|
||||
collision_mask="water-tile",
|
||||
collision_mask="player-layer",
|
||||
limit = 1
|
||||
}
|
||||
|
||||
@ -532,8 +533,8 @@ function Upgrade.addUniverseProperties()
|
||||
global.universePropertyVersion = 2
|
||||
Universe.hiveDataIterator = nil
|
||||
end
|
||||
if global.universePropertyVersion < 3 then
|
||||
global.universePropertyVersion = 3
|
||||
if global.universePropertyVersion < 4 then
|
||||
global.universePropertyVersion = 4
|
||||
addCommandSet()
|
||||
end
|
||||
end
|
||||
@ -628,6 +629,18 @@ function Upgrade.attempt()
|
||||
Universe.hiveIterator = nil
|
||||
Universe.hiveDataIterator = nil
|
||||
end
|
||||
if global.gameVersion < 4 then
|
||||
global.gameVersion = 4
|
||||
|
||||
local tick = game.tick
|
||||
|
||||
for _, map in pairs(Universe.maps) do
|
||||
local surface = map.surface
|
||||
if surface.valid then
|
||||
MapUtils.queueChunks(surface, surface.get_chunks(), true, tick)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function Upgrade.init(universe)
|
||||
|
Loading…
Reference in New Issue
Block a user