1
0
mirror of https://github.com/veden/Rampant.git synced 2025-03-17 20:58:35 +02:00

baseIds are now unique across all surfaces

This commit is contained in:
Aaron Veden 2021-12-11 10:45:40 -08:00
parent d150e54bcb
commit 0cdacdfba4
No known key found for this signature in database
GPG Key ID: FF5990B1C6DD3F84
2 changed files with 4 additions and 3 deletions

View File

@ -507,6 +507,7 @@ function upgrade.attempt(universe)
universe.chunkToRallys = {}
universe.chunkToPassScan = {}
universe.chunkToPassScanIterator = nil
universe.baseId = 0
game.print("Rampant - Version 2.0.0")
end
@ -590,7 +591,6 @@ function upgrade.prepMap(universe, surface)
map.baseIncrement = 0
map.points = 0
map.state = constants.AI_STATE_AGGRESSIVE
map.baseId = 0
map.squads = nil
map.pendingAttack = nil
map.building = nil

View File

@ -501,6 +501,7 @@ function baseUtils.createBase(map, chunk, tick)
BASE_DISTANCE_THRESHOLD * 1.50,
map.random)
local distanceThreshold = (baseLevel * BASE_DISTANCE_LEVEL_BONUS) + baseDistanceThreshold
local universe = map.universe
local base = {
x = x,
@ -516,9 +517,9 @@ function baseUtils.createBase(map, chunk, tick)
chunkCount = 0,
createdTick = tick,
points = 0,
id = map.baseId
id = universe.baseId
}
map.baseId = map.baseId + 1
universe.baseId = universe.baseId + 1
map.bases[base.id] = base