1
0
mirror of https://github.com/veden/Rampant.git synced 2024-12-28 21:08:22 +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:
Aaron Veden 2021-12-27 13:48:46 -08:00
parent aabb228171
commit cf841f9f81
No known key found for this signature in database
GPG Key ID: FF5990B1C6DD3F84
2 changed files with 30 additions and 13 deletions

View File

@ -37,6 +37,20 @@ local processPendingChunks = chunkProcessor.processPendingChunks
-- 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)
-- preallocating memory to be used in code, making it fast by reducing garbage generated.
queriesAndCommands.neighbors = {
@ -529,6 +543,19 @@ function upgrade.attempt(universe)
if global.version < 207 then
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
addBasesToAllEnemyStructures(universe, game.tick)
end
@ -541,22 +568,11 @@ end
function upgrade.prepMap(universe, surface)
local surfaceName = surface.name
if 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- ")
then
if isExcludedSurface(surfaceName) then
return
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

View File

@ -4,6 +4,7 @@ Date: 17. 12. 2021
Improvements:
- Added RTStasisRealm to surface 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:
- Fixed onBuilderArrived if the builder was a unit and not a group (Thanks DBotThePony for reporting)
- Fixed adding player to chunk crash