From df811b2ced733f15155bcbdc2c018214b754414a Mon Sep 17 00:00:00 2001 From: Aaron Veden Date: Sat, 27 Jan 2018 12:57:50 -0800 Subject: [PATCH] fix kamikaze and deadzones --- Upgrade.lua | 8 +++++--- changelog.txt | 7 +++++++ info.json | 2 +- libs/BaseUtils.lua | 4 +++- libs/ChunkUtils.lua | 5 ++++- libs/Constants.lua | 2 +- locale/en/locale.cfg | 2 +- 7 files changed, 22 insertions(+), 8 deletions(-) diff --git a/Upgrade.lua b/Upgrade.lua index 9ac2466..2dcfaa4 100755 --- a/Upgrade.lua +++ b/Upgrade.lua @@ -184,10 +184,12 @@ function upgrade.attempt(natives) game.surfaces[1].print("Rampant - Version 0.16.6") global.version = constants.VERSION_41 end - if (global.version < constants.VERSION_43) then + if (global.version < constants.VERSION_44) then + + natives.kamikazeThreshold = 0 - game.surfaces[1].print("Rampant - Version 0.16.8") - global.version = constants.VERSION_43 + game.surfaces[1].print("Rampant - Version 0.16.9") + global.version = constants.VERSION_44 end return starting ~= global.version, natives diff --git a/changelog.txt b/changelog.txt index eb11d20..61e7a11 100755 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,10 @@ +--------------------------------------------------------------------------------------------------- +Version: 0.16.9 +Date: 1. 27. 2018 + Bugfixes: + - Fixed uninitialized kamikazeThreshold + - Fixed that deadzones wouldn't expire allowing for resettling + --------------------------------------------------------------------------------------------------- Version: 0.16.8 Date: 1. 26. 2018 diff --git a/info.json b/info.json index bce022f..4b4a7a0 100755 --- a/info.json +++ b/info.json @@ -1,7 +1,7 @@ { "name" : "Rampant", "factorio_version" : "0.16", - "version" : "0.16.8", + "version" : "0.16.9", "title" : "Rampant", "author" : "Veden", "homepage" : "https://forums.factorio.com/viewtopic.php?f=94&t=31445", diff --git a/libs/BaseUtils.lua b/libs/BaseUtils.lua index 9ce6aea..16c0ccf 100755 --- a/libs/BaseUtils.lua +++ b/libs/BaseUtils.lua @@ -315,7 +315,9 @@ function baseUtils.createBase(map, natives, evolutionFactor, chunk, surface, tic points = 0 } - setChunkBase(map, chunk, base) + if (alignment ~= BASE_ALIGNMENT_DEADZONE) then + setChunkBase(map, chunk, base) + end -- if not buildHive(map, base, surface) then -- return nil diff --git a/libs/ChunkUtils.lua b/libs/ChunkUtils.lua index 5e0e39c..c0aad69 100755 --- a/libs/ChunkUtils.lua +++ b/libs/ChunkUtils.lua @@ -33,6 +33,7 @@ local CHUNK_IMPASSABLE = constants.CHUNK_IMPASSABLE local CHUNK_TICK = constants.CHUNK_TICK local BASE_SEARCH_RADIUS = constants.BASE_SEARCH_RADIUS +local BASE_ALIGNMENT_DEADZONE = constants.BASE_ALIGNMENT_DEADZONE local PATH_RATING = constants.PATH_RATING @@ -282,7 +283,9 @@ function chunkUtils.initialScan(chunk, natives, surface, map, tick, evolutionFac if natives.newEnemies and ((#nests > 0) or (#worms > 0)) then local base = findNearbyBase(map, chunk, natives) if base then - setChunkBase(map, chunk, base) + if (base.alignment ~= BASE_ALIGNMENT_DEADZONE) then + setChunkBase(map, chunk, base) + end else base = createBase(map, natives, evolutionFactor, chunk, surface, tick) end diff --git a/libs/Constants.lua b/libs/Constants.lua index cf90874..6fdbc1b 100755 --- a/libs/Constants.lua +++ b/libs/Constants.lua @@ -18,7 +18,7 @@ constants.VERSION_28 = 28 constants.VERSION_33 = 33 constants.VERSION_38 = 38 constants.VERSION_41 = 41 -constants.VERSION_43 = 43 +constants.VERSION_44 = 44 -- misc diff --git a/locale/en/locale.cfg b/locale/en/locale.cfg index 61cab66..f9a2465 100755 --- a/locale/en/locale.cfg +++ b/locale/en/locale.cfg @@ -9060,4 +9060,4 @@ rampant-attack-warning=Shows a message warning players that an attack wave is in rampant-newEnemies=Adds news enemies that will be dispersed over the world. This increases the RAM requirements minimum 2GB to 8GB. rampant-enemySeed=The seed that powers all of the unit generation, so change this if you want the enemy stats to change rampant-deadZoneFrequency=The percentage of zones that start out with worms or nests -rampant-newEnemyVariations=This number corresponds to the number of variations per tier of of each unit, unit spawner, and worm types. This increases the RAM requirements minimum 2GB to 8GB. \ No newline at end of file +rampant-newEnemyVariations=This number corresponds to the number of variations per tier of of each unit, unit spawner, and worm types. This increases the RAM requirements minimum 2GB to 8GB. Min 1, Max 20 \ No newline at end of file