mirror of
https://github.com/veden/Rampant.git
synced 2025-03-17 20:58:35 +02:00
fixed no new enemies mod path in registering and unregistering enemy structures
This commit is contained in:
parent
2772010851
commit
96094237f6
@ -331,10 +331,13 @@ function chunkUtils.mapScanEnemyChunk(chunk, map, tick)
|
|||||||
for i=1,#HIVE_BUILDINGS_TYPES do
|
for i=1,#HIVE_BUILDINGS_TYPES do
|
||||||
counts[HIVE_BUILDINGS_TYPES[i]] = 0
|
counts[HIVE_BUILDINGS_TYPES[i]] = 0
|
||||||
end
|
end
|
||||||
local base = findNearbyBase(map, chunk)
|
local base
|
||||||
|
if universe.NEW_ENEMIES then
|
||||||
|
base = findNearbyBase(map, chunk)
|
||||||
if not base then
|
if not base then
|
||||||
base = createBase(map, chunk, tick)
|
base = createBase(map, chunk, tick)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
for i=1,#buildings do
|
for i=1,#buildings do
|
||||||
local building = buildings[i]
|
local building = buildings[i]
|
||||||
|
|
||||||
@ -437,6 +440,7 @@ function chunkUtils.registerEnemyBaseStructure(map, entity, tick, incomingBase)
|
|||||||
for i=1,#chunks do
|
for i=1,#chunks do
|
||||||
local chunk = chunks[i]
|
local chunk = chunks[i]
|
||||||
if (chunk ~= -1) then
|
if (chunk ~= -1) then
|
||||||
|
if universe.NEW_ENEMIES then
|
||||||
local base = incomingBase
|
local base = incomingBase
|
||||||
if not base then
|
if not base then
|
||||||
base = findNearbyBase(map, chunk)
|
base = findNearbyBase(map, chunk)
|
||||||
@ -444,8 +448,9 @@ function chunkUtils.registerEnemyBaseStructure(map, entity, tick, incomingBase)
|
|||||||
base = createBase(map, chunk, tick)
|
base = createBase(map, chunk, tick)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
addFunc(map, chunk, entityUnitNumber)
|
|
||||||
setChunkBase(map, chunk, base)
|
setChunkBase(map, chunk, base)
|
||||||
|
end
|
||||||
|
addFunc(map, chunk, entityUnitNumber)
|
||||||
if (hiveType == "spitter-spawner") or (hiveType == "biter-spawner") then
|
if (hiveType == "spitter-spawner") or (hiveType == "biter-spawner") then
|
||||||
processNestActiveness(map, chunk)
|
processNestActiveness(map, chunk)
|
||||||
end
|
end
|
||||||
@ -490,6 +495,12 @@ function chunkUtils.unregisterEnemyBaseStructure(map, entity, damageType)
|
|||||||
for i=1,#chunks do
|
for i=1,#chunks do
|
||||||
local chunk = chunks[i]
|
local chunk = chunks[i]
|
||||||
if (chunk ~= -1) then
|
if (chunk ~= -1) then
|
||||||
|
if (hiveType == "spitter-spawner") or (hiveType == "biter-spawner") then
|
||||||
|
setRaidNestActiveness(map, chunk, 0)
|
||||||
|
setNestActiveness(map, chunk, 0)
|
||||||
|
end
|
||||||
|
removeFunc(map, chunk, entityUnitNumber)
|
||||||
|
if map.universe.NEW_ENEMIES then
|
||||||
local base = getChunkBase(map, chunk)
|
local base = getChunkBase(map, chunk)
|
||||||
if damageType and usedBases[base.id] then
|
if damageType and usedBases[base.id] then
|
||||||
usedBases[base.id] = true
|
usedBases[base.id] = true
|
||||||
@ -497,17 +508,13 @@ function chunkUtils.unregisterEnemyBaseStructure(map, entity, damageType)
|
|||||||
base.damagedBy[damageTypeName] = (base.damagedBy[damageTypeName] or 0) + 3
|
base.damagedBy[damageTypeName] = (base.damagedBy[damageTypeName] or 0) + 3
|
||||||
base.deathEvents = base.deathEvents + 3
|
base.deathEvents = base.deathEvents + 3
|
||||||
end
|
end
|
||||||
if (hiveType == "spitter-spawner") or (hiveType == "biter-spawner") then
|
|
||||||
setRaidNestActiveness(map, chunk, 0)
|
|
||||||
setNestActiveness(map, chunk, 0)
|
|
||||||
end
|
|
||||||
removeFunc(map, chunk, entityUnitNumber)
|
|
||||||
if (getEnemyStructureCount(map, chunk) <= 0) then
|
if (getEnemyStructureCount(map, chunk) <= 0) then
|
||||||
removeChunkBase(map, chunk, base)
|
removeChunkBase(map, chunk, base)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function chunkUtils.accountPlayerEntity(entity, map, addObject, creditNatives)
|
function chunkUtils.accountPlayerEntity(entity, map, addObject, creditNatives)
|
||||||
if (BUILDING_PHEROMONES[entity.type] ~= nil) and (entity.force.name ~= "enemy") then
|
if (BUILDING_PHEROMONES[entity.type] ~= nil) and (entity.force.name ~= "enemy") then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user