mirror of
https://github.com/veden/Rampant.git
synced 2025-02-11 13:39:05 +02:00
FACTO-11: Corrected vanilla buildings not being detected for upgrades
This commit is contained in:
parent
f2ed7893c9
commit
46d2d0ce51
@ -609,6 +609,7 @@ function upgrade.attempt(universe)
|
|||||||
end
|
end
|
||||||
|
|
||||||
universe.proxyEntityLookup = {}
|
universe.proxyEntityLookup = {}
|
||||||
|
universe.vanillaEntityLookups = {}
|
||||||
|
|
||||||
game.print("Rampant - Version 2.2.0")
|
game.print("Rampant - Version 2.2.0")
|
||||||
end
|
end
|
||||||
|
@ -584,6 +584,8 @@ function baseUtils.rebuildNativeTables(universe, rg)
|
|||||||
universe.buildingHiveTypeLookup = buildingHiveTypeLookup
|
universe.buildingHiveTypeLookup = buildingHiveTypeLookup
|
||||||
local proxyEntityLookup = {}
|
local proxyEntityLookup = {}
|
||||||
universe.proxyEntityLookup = proxyEntityLookup
|
universe.proxyEntityLookup = proxyEntityLookup
|
||||||
|
local vanillaEntityLookups = {}
|
||||||
|
universe.vanillaEntityTypeLookup = vanillaEntityLookups
|
||||||
|
|
||||||
for i=1,10 do
|
for i=1,10 do
|
||||||
evoToTierMapping[#evoToTierMapping+1] = (((i - 1) * 0.1) ^ 0.5) - 0.05
|
evoToTierMapping[#evoToTierMapping+1] = (((i - 1) * 0.1) ^ 0.5) - 0.05
|
||||||
@ -596,6 +598,13 @@ function baseUtils.rebuildNativeTables(universe, rg)
|
|||||||
buildingHiveTypeLookup["big-worm-turret"] = "turret"
|
buildingHiveTypeLookup["big-worm-turret"] = "turret"
|
||||||
buildingHiveTypeLookup["behemoth-worm-turret"] = "turret"
|
buildingHiveTypeLookup["behemoth-worm-turret"] = "turret"
|
||||||
|
|
||||||
|
vanillaEntityLookups["biter-spawner"] = true
|
||||||
|
vanillaEntityLookups["spitter-spawner"] = true
|
||||||
|
vanillaEntityLookups["small-worm-turret"] = true
|
||||||
|
vanillaEntityLookups["medium-worm-turret"] = true
|
||||||
|
vanillaEntityLookups["big-worm-turret"] = true
|
||||||
|
vanillaEntityLookups["behemoth-worm-turret"] = true
|
||||||
|
|
||||||
for i=1,#FACTION_SET do
|
for i=1,#FACTION_SET do
|
||||||
local faction = FACTION_SET[i]
|
local faction = FACTION_SET[i]
|
||||||
|
|
||||||
|
@ -237,6 +237,7 @@ function chunkUtils.initialScan(chunk, map, tick)
|
|||||||
if (pass ~= CHUNK_IMPASSABLE) then
|
if (pass ~= CHUNK_IMPASSABLE) then
|
||||||
local resources = surface.count_entities_filtered(universe.isCountResourcesQuery) * RESOURCE_NORMALIZER
|
local resources = surface.count_entities_filtered(universe.isCountResourcesQuery) * RESOURCE_NORMALIZER
|
||||||
|
|
||||||
|
local vanillaEntityTypeLookup = universe.vanillaEntityTypeLookup
|
||||||
local buildingHiveTypeLookup = universe.buildingHiveTypeLookup
|
local buildingHiveTypeLookup = universe.buildingHiveTypeLookup
|
||||||
local counts = map.chunkScanCounts
|
local counts = map.chunkScanCounts
|
||||||
for i=1,#HIVE_BUILDINGS_TYPES do
|
for i=1,#HIVE_BUILDINGS_TYPES do
|
||||||
@ -260,9 +261,10 @@ function chunkUtils.initialScan(chunk, map, tick)
|
|||||||
|
|
||||||
for i = 1, #enemyBuildings do
|
for i = 1, #enemyBuildings do
|
||||||
local enemyBuilding = enemyBuildings[i]
|
local enemyBuilding = enemyBuildings[i]
|
||||||
|
|
||||||
chunkUtils.registerEnemyBaseStructure(map, enemyBuilding, tick, base)
|
chunkUtils.registerEnemyBaseStructure(map, enemyBuilding, tick, base)
|
||||||
if not buildingHiveTypeLookup[enemyBuilding.name] then
|
local entityName = enemyBuilding.name
|
||||||
|
local isVanilla = vanillaEntityTypeLookup[entityName]
|
||||||
|
if isVanilla or (not isVanilla and not buildingHiveTypeLookup[entityName]) then
|
||||||
upgradeEntity(enemyBuilding, base, map, nil, true)
|
upgradeEntity(enemyBuilding, base, map, nil, true)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user