Skip to content

Commit

Permalink
removing conditional requires everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
veden committed Apr 14, 2018
1 parent 3b1b94a commit 352a92b
Show file tree
Hide file tree
Showing 19 changed files with 13,583 additions and 13,464 deletions.
6 changes: 3 additions & 3 deletions control.lua
Expand Up @@ -304,9 +304,6 @@ local function onConfigChanged()
upgraded, natives = upgrade.attempt(natives)
if upgraded and onModSettingsChange(nil) then
rebuildMap()
if natives.newEnemies then
rebuildNativeTables(natives, game.surfaces[1], game.create_random_generator(natives.enemySeed))
end
-- clear pending chunks, will be added when loop runs below
global.pendingChunks = {}
Expand All @@ -324,6 +321,9 @@ local function onConfigChanged()
processPendingChunks(natives, map, surface, pendingChunks, tick, game.forces.enemy.evolution_factor, true)
end
if natives.newEnemies then
rebuildNativeTables(natives, game.surfaces[1], game.create_random_generator(natives.enemySeed))
end
end
script.on_nth_tick(INTERVAL_PROCESS,
Expand Down
44 changes: 31 additions & 13 deletions data-final-fixes.lua
@@ -1,22 +1,40 @@
local vanillaBuildings = require("prototypes/buildings/UpdatesVanilla")

local neutral = require("prototypes/Neutral")
local acid = require("prototypes/Acid")
local physical = require("prototypes/Physical")
local suicide = require("prototypes/Suicide")
local fire = require("prototypes/Fire")
local electric = require("prototypes/Electric")
local nuclear = require("prototypes/Nuclear")
local inferno = require("prototypes/Inferno")
local fast = require("prototypes/Fast")
local troll = require("prototypes/Troll")
-- require("prototypes/Decaying")
-- require("prototypes/Poison")
-- require("prototypes/Undying")
local spawner = require("prototypes/Spawner")
local wasp = require("prototypes/Wasp")
local laser = require("prototypes/Laser")

if settings.startup["rampant-newEnemies"].value then
require("prototypes/Neutral")
require("prototypes/Acid")
require("prototypes/Physical")
require("prototypes/Suicide")
require("prototypes/Fire")
require("prototypes/Electric")
require("prototypes/Nuclear")
require("prototypes/Inferno")
require("prototypes/Fast")
require("prototypes/Troll")

neutral.addFaction()
acid.addFaction()
physical.addFaction()
suicide.addFaction()
fire.addFaction()
electric.addFaction()
nuclear.addFaction()
inferno.addFaction()
fast.addFaction()
troll.addFaction()
-- require("prototypes/Decaying")
-- require("prototypes/Poison")
-- require("prototypes/Undying")
require("prototypes/Spawner")
require("prototypes/Wasp")
require("prototypes/Laser")
spawner.addFaction()
wasp.addFaction()
laser.addFaction()

for _, unitSpawner in pairs(data.raw["unit-spawner"]) do
if (unitSpawner.name ~= "biter-spawner") then
Expand Down
8 changes: 5 additions & 3 deletions data-updates.lua
Expand Up @@ -3,6 +3,9 @@ local bobsUpdates = require("prototypes/utils/UpdatesBobs")
local NEUpdates = require("prototypes/utils/UpdatesNE")
local constants = require("libs/Constants")

local attackBobs = require("prototypes/utils/AttackBobs")
local attackNE = require("prototypes/utils/AttackNE")

if settings.startup["rampant-removeBloodParticles"].value then
local explosions = data.raw["explosion"]

Expand All @@ -16,14 +19,13 @@ if settings.startup["rampant-useDumbProjectiles"].value then

local option = settings.startup["bobmods-enemies-enableartifacts"]
if option then

require("prototypes/utils/AttackBobs")
attackBobs.addAttacks()
bobsUpdates.useDumbProjectiles()
end

option = settings.startup["NE_Difficulty"]
if option then
require("prototypes/utils/AttackNE")
attackNE.addAttacks()
NEUpdates.useDumbProjectiles()
if settings.startup["rampant-useNEUnitLaunchers"].value then
NEUpdates.useNEUnitLaunchers()
Expand Down
2 changes: 2 additions & 0 deletions libs/ChunkUtils.lua
Expand Up @@ -369,6 +369,8 @@ end
function chunkUtils.analyzeChunk(chunk, natives, surface, map)
local playerObjects = chunkUtils.scorePlayerBuildings(surface, map, natives)
setPlayerBaseGenerator(map, chunk, playerObjects)
local resources = surface.count_entities_filtered(map.countResourcesQuery) * RESOURCE_NORMALIZER
setResourceGenerator(map, chunk, resources)
end

function chunkUtils.createChunk(topX, topY)
Expand Down

0 comments on commit 352a92b

Please sign in to comment.