mirror of
https://github.com/veden/Rampant.git
synced 2024-12-30 21:19:46 +02:00
Corrected SE spaceship exclusion list entry and added pass to remove
already existing maps that are on the exclusion list
This commit is contained in:
parent
aabb228171
commit
cf841f9f81
42
Upgrade.lua
42
Upgrade.lua
@ -37,6 +37,20 @@ local processPendingChunks = chunkProcessor.processPendingChunks
|
|||||||
|
|
||||||
-- module code
|
-- module code
|
||||||
|
|
||||||
|
local function isExcludedSurface(surfaceName)
|
||||||
|
return sFind(surfaceName, "Factory floor") or
|
||||||
|
sFind(surfaceName, " Orbit") or
|
||||||
|
sFind(surfaceName, "clonespace") or
|
||||||
|
sFind(surfaceName, "BPL_TheLabplayer") or
|
||||||
|
sFind(surfaceName, "starmap-") or
|
||||||
|
(surfaceName == "aai-signals") or
|
||||||
|
sFind(surfaceName, "NiceFill") or
|
||||||
|
sFind(surfaceName, "Asteroid Belt") or
|
||||||
|
sFind(surfaceName, "Vault ") or
|
||||||
|
(surfaceName == "RTStasisRealm") or
|
||||||
|
sFind(surfaceName, "spaceship")
|
||||||
|
end
|
||||||
|
|
||||||
local function addCommandSet(queriesAndCommands)
|
local function addCommandSet(queriesAndCommands)
|
||||||
-- preallocating memory to be used in code, making it fast by reducing garbage generated.
|
-- preallocating memory to be used in code, making it fast by reducing garbage generated.
|
||||||
queriesAndCommands.neighbors = {
|
queriesAndCommands.neighbors = {
|
||||||
@ -529,6 +543,19 @@ function upgrade.attempt(universe)
|
|||||||
if global.version < 207 then
|
if global.version < 207 then
|
||||||
global.version = 207
|
global.version = 207
|
||||||
|
|
||||||
|
for mapId,map in pairs(universe.maps) do
|
||||||
|
local toBeRemoved = not map.surface.valid or isExcludedSurface(map.surface.name)
|
||||||
|
if toBeRemoved then
|
||||||
|
if universe.mapIterator == mapId then
|
||||||
|
universe.mapIterator, universe.activeMap = next(universe.maps, universe.mapIterator)
|
||||||
|
end
|
||||||
|
if universe.processMapAIIterator == mapId then
|
||||||
|
universe.processMapAIIterator = nil
|
||||||
|
end
|
||||||
|
universe.maps[mapId] = nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if universe.NEW_ENEMIES then
|
if universe.NEW_ENEMIES then
|
||||||
addBasesToAllEnemyStructures(universe, game.tick)
|
addBasesToAllEnemyStructures(universe, game.tick)
|
||||||
end
|
end
|
||||||
@ -541,22 +568,11 @@ end
|
|||||||
|
|
||||||
function upgrade.prepMap(universe, surface)
|
function upgrade.prepMap(universe, surface)
|
||||||
local surfaceName = surface.name
|
local surfaceName = surface.name
|
||||||
if sFind(surfaceName, "Factory floor") or
|
if isExcludedSurface(surfaceName) then
|
||||||
sFind(surfaceName, " Orbit") or
|
|
||||||
sFind(surfaceName, "clonespace") or
|
|
||||||
sFind(surfaceName, "BPL_TheLabplayer") or
|
|
||||||
sFind(surfaceName, "starmap-") or
|
|
||||||
(surfaceName == "aai-signals") or
|
|
||||||
sFind(surfaceName, "NiceFill") or
|
|
||||||
sFind(surfaceName, "Asteroid Belt") or
|
|
||||||
sFind(surfaceName, "Vault ") or
|
|
||||||
(surfaceName == "RTStasisRealm") or
|
|
||||||
sFind(surfaceName, "spaceship- ")
|
|
||||||
then
|
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
game.print("Rampant - Indexing surface:" .. surface.name .. ", index:" .. tostring(surface.index) .. ", please wait.")
|
game.print("Rampant - Indexing surface:" .. surfaceName .. ", index:" .. tostring(surface.index) .. ", please wait.")
|
||||||
|
|
||||||
local surfaceIndex = surface.index
|
local surfaceIndex = surface.index
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@ Date: 17. 12. 2021
|
|||||||
Improvements:
|
Improvements:
|
||||||
- Added RTStasisRealm to surface exclusion list
|
- Added RTStasisRealm to surface exclusion list
|
||||||
- Added space exploration spaceship surface to exclusion list
|
- Added space exploration spaceship surface to exclusion list
|
||||||
|
- Added pass during upgrade to remove in-memory maps that are on the exclusion list for surfaces
|
||||||
Bugfixes:
|
Bugfixes:
|
||||||
- Fixed onBuilderArrived if the builder was a unit and not a group (Thanks DBotThePony for reporting)
|
- Fixed onBuilderArrived if the builder was a unit and not a group (Thanks DBotThePony for reporting)
|
||||||
- Fixed adding player to chunk crash
|
- Fixed adding player to chunk crash
|
||||||
|
Loading…
Reference in New Issue
Block a user