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_search_distance = CHUNK_SIZE
}
end
queriesAndCommands.setCommandForces = function (npcForces, enemyForces)
for force in pairs(queriesAndCommands.playerForces) do
queriesAndCommands.playerForces[force] = nil
end
for force in pairs(queriesAndCommands.npcForces) do
queriesAndCommands.npcForces[force] = nil
end
for force in pairs(queriesAndCommands.enemyForces) do
queriesAndCommands.enemyForces[force] = nil
end
for force in pairs(queriesAndCommands.nonPlayerForces) do
queriesAndCommands.nonPlayerForces[force] = nil
end
for _,force in pairs(game.forces) do
if not npcForces[force.name] and not enemyForces[force.name] then
queriesAndCommands.playerForces[#queriesAndCommands.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
function upgrade.setCommandForces(universe, npcForces, enemyForces)
for force in pairs(universe.playerForces) do
universe.playerForces[force] = nil
end
for force in pairs(universe.npcForces) do
universe.npcForces[force] = nil
end
for force in pairs(universe.enemyForces) do
universe.enemyForces[force] = nil
end
for force in pairs(universe.nonPlayerForces) do
universe.nonPlayerForces[force] = nil
end
for _,force in pairs(game.forces) do
if not npcForces[force.name] and not enemyForces[force.name] then
universe.playerForces[#universe.playerForces+1] = force.name
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
function upgrade.attempt(universe)

View File

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