From 4ebff567e17d9e53e9ce411ea88679eb80be8075 Mon Sep 17 00:00:00 2001 From: Aaron Veden Date: Fri, 26 Jan 2018 18:51:48 -0800 Subject: [PATCH] fix for empty interval --- README.md | 4 ++-- Upgrade.lua | 6 +++--- changelog.txt | 6 ++++++ libs/BaseUtils.lua | 2 +- libs/Constants.lua | 2 +- 5 files changed, 13 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 4ffb937..056bd2d 100755 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Rampant Tactics -Factorio Mod - Improves the enemies tactics by using potential fields/pheromones allowing probing of defenses, retreats, reinforcements, counterattacking, breaching, rallying death cry, and player hunting. Also removes homing biter projectiles. Adds new Enemies. Difficulty setting in mod options menu. +Factorio Mod - Improves the enemies tactics by using potential fields/pheromones allowing probing of defenses, retreats, reinforcements, counterattacking, breaching, rallying death cry, and player hunting. Also removes homing biter projectiles. Adds new Enemies. Difficulty setting in mod options menu. # Forum Post @@ -26,7 +26,7 @@ Configure Options not in game menu: # Features -- New Enemy Factions - Neutral, Acid, Fast, Physical, Electric, Inferno, Suicide, Fire, Nuclear, Laser, Troll +- New Enemy Factions - Neutral, Acid, Fast, Physical, Electric, Inferno, Suicide, Fire, Nuclear, Laser, Troll - Swarming - Units will smoothly slide by one another allowing for streamlined attacking - Difficulty Scaling - A mod option to control how quickly the ai can perform actions like making attack waves. - Nocturnal Mode - A mod option to force biters to only attack at night. Does not yet affect vanilla attacks. Best use with daynight extender mod diff --git a/Upgrade.lua b/Upgrade.lua index bcdad19..9ac2466 100755 --- a/Upgrade.lua +++ b/Upgrade.lua @@ -184,10 +184,10 @@ function upgrade.attempt(natives) game.surfaces[1].print("Rampant - Version 0.16.6") global.version = constants.VERSION_41 end - if (global.version < constants.VERSION_42) then + if (global.version < constants.VERSION_43) then - game.surfaces[1].print("Rampant - Version 0.16.7") - global.version = constants.VERSION_42 + game.surfaces[1].print("Rampant - Version 0.16.8") + global.version = constants.VERSION_43 end return starting ~= global.version, natives diff --git a/changelog.txt b/changelog.txt index 1161466..41f40a1 100755 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,9 @@ +--------------------------------------------------------------------------------------------------- +Version: 0.16.8 +Date: 1. 26. 2018 + Bugfixes: + - Added a check for 0 elements on_tick empty interval (https://forums.factorio.com/viewtopic.php?f=94&t=31445&start=220#p338531) + --------------------------------------------------------------------------------------------------- Version: 0.16.7 Date: 1. 26. 2018 diff --git a/libs/BaseUtils.lua b/libs/BaseUtils.lua index 8295db7..97c204b 100755 --- a/libs/BaseUtils.lua +++ b/libs/BaseUtils.lua @@ -236,7 +236,7 @@ end function baseUtils.upgradeBase(base) local paths = BASE_ALIGNMENT_PATHS[base.alignment] - if paths then + if paths and (#paths > 0) then base.alignment = paths[mRandom(#paths)] return true end diff --git a/libs/Constants.lua b/libs/Constants.lua index 089262a..0ce5537 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_42 = 42 +constants.VERSION_43 = 43 -- misc