From 9fb8705999ae4798881395ea991b838b5a4786dc Mon Sep 17 00:00:00 2001 From: Aaron Veden Date: Fri, 14 Jan 2022 11:36:42 -0800 Subject: [PATCH] FACTO-3: Fixed base alignment potentially being an empty array --- changelog.txt | 1 + libs/BaseUtils.lua | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/changelog.txt b/changelog.txt index f1d8fb2..d4f852a 100644 --- a/changelog.txt +++ b/changelog.txt @@ -10,6 +10,7 @@ Date: 29. 12. 2021 - Fixed random generator seed overflow (Thanks NeveHanter for the report) - Fixed removing chunks could index outside processQueueLength (Thanks thecheat789 for the report) - Fixed processMap and processStaticMap could index outside processQueueLength + - Fixed base alignments could be blank when removing factions (Thanks kind_killer for the report) Optimizations: - Added early stopping to removeProcessQueueChunk diff --git a/libs/BaseUtils.lua b/libs/BaseUtils.lua index b50a4d9..1fee834 100644 --- a/libs/BaseUtils.lua +++ b/libs/BaseUtils.lua @@ -274,6 +274,7 @@ function baseUtils.upgradeEntity(entity, base, map, disPos, evolve, register) else pickedBaseAlignment = baseAlignment[1] end + local spawnerName = findEntityUpgrade(pickedBaseAlignment, currentEvo, evoIndex, @@ -675,6 +676,9 @@ function baseUtils.rebuildNativeTables(universe, rg) if alignment and not universe.buildingEvolveLookup[alignment] then base.alignment = findBaseInitialAlignment(map, evoIndex) break + elseif not alignment and (x == 1) then + base.alignment = findBaseInitialAlignment(map, evoIndex) + break end end end