1
0
mirror of https://github.com/veden/Rampant.git synced 2025-01-28 03:29:34 +02:00

fixed enemy seed overflow

This commit is contained in:
Aaron Veden 2021-12-31 11:43:45 -08:00
parent c1aede18da
commit 50b9e66489
No known key found for this signature in database
GPG Key ID: FF5990B1C6DD3F84
3 changed files with 18 additions and 2 deletions

View File

@ -497,7 +497,6 @@ function upgrade.attempt(universe)
universe.eventId = 0
universe.chunkId = 0
universe.randomGenerator = nil
universe.random = game.create_random_generator(settings.startup["rampant--enemySeed"].value+game.default_map_gen_settings.seed)
game.forces.enemy.kill_all_units()
universe.maps = {}
universe.chunkIdToChunk = {}
@ -568,8 +567,20 @@ function upgrade.attempt(universe)
universe.expansionMediumTargetDistance = (universe.expansionMaxDistance + MINIMUM_EXPANSION_DISTANCE) * 0.50
universe.expansionHighTargetDistance = (universe.expansionMaxDistance + MINIMUM_EXPANSION_DISTANCE) * 0.75
universe.expansionDistanceDeviation = universe.expansionMediumTargetDistance * 0.33
end
if global.version < 209 then
global.version = 209
game.print("Rampant - Version 2.1.1")
if not universe.random then
local combinedSeed = settings.startup["rampant--enemySeed"].value+game.default_map_gen_settings.seed
if (combinedSeed > 4294967295) then
universe.random = game.create_random_generator(combinedSeed % 4294967295)
elseif not universe.random then
universe.random = game.create_random_generator(combinedSeed)
end
end
game.print("Rampant - Version 2.2.0")
end
return (starting ~= global.version) and global.version

View File

@ -1,6 +1,10 @@
---------------------------------------------------------------------------------------------------
Version: 2.2.0
Date: 29. 12. 2021
Tweaks:
- Set maximum value on enemy seed to 4294967295
Bugfixes:
- Fixed random generator seed overflow (Thanks NeveHanter for the report)
---------------------------------------------------------------------------------------------------
Version: 2.1.2

View File

@ -272,6 +272,7 @@ data:extend({
setting_type = "startup",
minimum_value = 1,
default_value = 1024567,
maximum_value = 4294967295,
order = "l[modifer]-b[unit]",
per_user = false
},