1
0
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:
Aaron Veden 2023-01-02 19:08:32 -08:00
parent 15f278b5d8
commit 1824943dce
No known key found for this signature in database
GPG Key ID: FF5990B1C6DD3F84
3 changed files with 4 additions and 7 deletions

View File

@ -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

View File

@ -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

View File

@ -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)