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:
parent
c217a8f82d
commit
2a602d7431
@ -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
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user