1
0
mirror of https://github.com/veden/Rampant.git synced 2024-12-28 21:08:22 +02:00

fixed victory scent dispersal

This commit is contained in:
Aaron Veden 2021-11-25 10:20:33 -08:00
parent c217a8f82d
commit 2a602d7431
No known key found for this signature in database
GPG Key ID: FF5990B1C6DD3F84
2 changed files with 12 additions and 8 deletions

View File

@ -18,6 +18,7 @@ Date: 23. 11. 2021
- Fixed new enemy regional base recycling would only process half the bases
- Fixed new enemy adaptation due to damage type not correctly calculating probability for adaptation
- Fixed squad cleanup would periodically skip a squad when cleaning up dead unit groups
- Fixed enemy destroying a player structure only processing half of the chunks it should have been
---------------------------------------------------------------------------------------------------
Version: 1.1.4

View File

@ -63,11 +63,18 @@ function pheromoneUtils.victoryScent(map, chunk, entityType)
end
function pheromoneUtils.disperseVictoryScent(map)
local iterator = map.victoryScentIterator
local chunk = map.victoryScentIterator
local chunkToVictory = map.chunkToVictory
local chunk,pheromone = next(chunkToVictory, iterator)
if chunk then
local pheromone
if not chunk then
chunk, pheromone = next(chunkToVictory, nil)
else
pheromone = chunkToVictory[chunk]
end
if not chunk then
map.victoryScentIterator = nil
else
map.victoryScentIterator = next(chunkToVictory, chunk)
local chunkX = chunk.x
local chunkY = chunk.y
local i = 1
@ -81,12 +88,8 @@ function pheromoneUtils.disperseVictoryScent(map)
end
end
local newChunk = next(chunkToVictory, chunk)
chunkToVictory[chunk] = nil
chunk = newChunk
end
map.victoryScentIterator = chunk
end
function pheromoneUtils.deathScent(map, chunk)