mirror of
https://github.com/veden/Rampant.git
synced 2025-03-17 20:58:35 +02:00
0eefa00: fixed death pheromone not spreading negative values correctly
This commit is contained in:
parent
15f278b5d8
commit
1824943dce
@ -26,6 +26,7 @@ Version: 3.2.0
|
||||
- Corrected typo of `randominess` to `randomness` in tooltips
|
||||
- Fixed alignmentTable being nil due to an invalid reference to the neutral faction
|
||||
- Bases can no longer spend points that exceed the overflow limit (Dagothur)
|
||||
- Fixed death pheromone spread being initialized to 0 instead of max negative number causing victory scent to spread incorrectly
|
||||
Optimizations:
|
||||
- Moved most constants out of global
|
||||
- Removed new enemy variations setting
|
||||
|
@ -447,15 +447,11 @@ function chunkPropertyUtils.setPathRating(map, chunk, value)
|
||||
end
|
||||
|
||||
function chunkPropertyUtils.addDeathGenerator(map, chunk, value)
|
||||
local v = (map.chunkToDeathGenerator[chunk.id] or 0) + value
|
||||
if (v >= 1) then
|
||||
v = 0.9999
|
||||
end
|
||||
map.chunkToDeathGenerator[chunk.id] = v
|
||||
map.chunkToDeathGenerator[chunk.id] = (map.chunkToDeathGenerator[chunk.id] or 0) + value
|
||||
end
|
||||
|
||||
function chunkPropertyUtils.setDeathGenerator(map, chunk, value)
|
||||
if (value <= 0.001) then
|
||||
if (value <= 0.001) and (value >= -0.001) then
|
||||
map.chunkToDeathGenerator[chunk.id] = nil
|
||||
else
|
||||
map.chunkToDeathGenerator[chunk.id] = value
|
||||
|
@ -408,7 +408,7 @@ end
|
||||
|
||||
function pheromoneUtils.processPheromone(map, chunk, player)
|
||||
local chunkPlayer = -MAGIC_MAXIMUM_NUMBER
|
||||
local chunkDeath = 0
|
||||
local chunkDeath = -MAGIC_MAXIMUM_NUMBER
|
||||
local chunkPathRating = getPathRating(map, chunk)
|
||||
|
||||
local tempNeighbors = getNeighborChunks(map, chunk.x, chunk.y)
|
||||
|
Loading…
x
Reference in New Issue
Block a user