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:
parent
1e7a45f661
commit
424b7a6d9d
50
Upgrade.lua
50
Upgrade.lua
@ -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)
|
||||||
|
@ -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 = {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user