1
0
mirror of https://github.com/veden/Rampant.git synced 2025-01-30 04:30:52 +02:00

removed setCommandForces function from global table

This commit is contained in:
Aaron Veden 2021-12-12 11:31:14 -08:00
parent 1e7a45f661
commit 424b7a6d9d
No known key found for this signature in database
GPG Key ID: FF5990B1C6DD3F84
2 changed files with 26 additions and 26 deletions

View File

@ -356,34 +356,34 @@ local function addCommandSet(queriesAndCommands)
unit_count = 1, unit_count = 1,
unit_search_distance = CHUNK_SIZE unit_search_distance = CHUNK_SIZE
} }
end
queriesAndCommands.setCommandForces = function (npcForces, enemyForces) function upgrade.setCommandForces(universe, npcForces, enemyForces)
for force in pairs(queriesAndCommands.playerForces) do for force in pairs(universe.playerForces) do
queriesAndCommands.playerForces[force] = nil universe.playerForces[force] = nil
end end
for force in pairs(queriesAndCommands.npcForces) do for force in pairs(universe.npcForces) do
queriesAndCommands.npcForces[force] = nil universe.npcForces[force] = nil
end end
for force in pairs(queriesAndCommands.enemyForces) do for force in pairs(universe.enemyForces) do
queriesAndCommands.enemyForces[force] = nil universe.enemyForces[force] = nil
end end
for force in pairs(queriesAndCommands.nonPlayerForces) do for force in pairs(universe.nonPlayerForces) do
queriesAndCommands.nonPlayerForces[force] = nil universe.nonPlayerForces[force] = nil
end end
for _,force in pairs(game.forces) do for _,force in pairs(game.forces) do
if not npcForces[force.name] and not enemyForces[force.name] then if not npcForces[force.name] and not enemyForces[force.name] then
queriesAndCommands.playerForces[#queriesAndCommands.playerForces+1] = force.name universe.playerForces[#universe.playerForces+1] = force.name
end
end
for force in pairs(enemyForces) do
queriesAndCommands.enemyForces[#queriesAndCommands.enemyForces+1] = force
queriesAndCommands.nonPlayerForces[#queriesAndCommands.nonPlayerForces+1] = force
end
for force in pairs(npcForces) do
queriesAndCommands.npcForces[#queriesAndCommands.npcForces+1] = force
queriesAndCommands.nonPlayerForces[#queriesAndCommands.nonPlayerForces+1] = force
end end
end end
for force in pairs(enemyForces) do
universe.enemyForces[#universe.enemyForces+1] = force
universe.nonPlayerForces[#universe.nonPlayerForces+1] = force
end
for force in pairs(npcForces) do
universe.npcForces[#universe.npcForces+1] = force
universe.nonPlayerForces[#universe.nonPlayerForces+1] = force
end
end end
function upgrade.attempt(universe) function upgrade.attempt(universe)

View File

@ -278,7 +278,7 @@ local function onConfigChanged()
npcForces["AbandonedRuins:enemy"] = true npcForces["AbandonedRuins:enemy"] = true
end end
universe.setCommandForces(npcForces, enemyForces) upgrade.setCommandForces(universe, npcForces, enemyForces)
if not universe.maps then if not universe.maps then
universe.maps = {} universe.maps = {}