mirror of
https://github.com/veden/Rampant.git
synced 2025-03-17 20:58:35 +02:00
adding max consecutive wanders to squads
This commit is contained in:
parent
47e20864e1
commit
15c140b728
@ -11,6 +11,7 @@ Date: 23. 11. 2021
|
||||
- Optimized regional base upgrades so that the work is spread over many ticks reducing lag spikes
|
||||
- Optimized adding new chunks to the Rampant in-memory state map
|
||||
- Added minimum building cost upgrade check before base upgrade performs scanning
|
||||
- Added max number of wander commands in a row for squads that aren't going anywhere before disbanding squad
|
||||
- Optimized energy thief faction
|
||||
- Factorissimo, Space Exploration Orbits, asteroid belts, secret maps, starmap, AAI-signal, NiceFill, Blueprint lab surfaces are no longer processed
|
||||
- Map processing around player now changes to the surface the player is standing on
|
||||
|
@ -364,12 +364,18 @@ function squadAttack.cleanSquads(map, tick)
|
||||
end
|
||||
squads[groupId] = nil
|
||||
elseif (group.state == 4) then
|
||||
squad.wanders = 0
|
||||
squadAttack.squadDispatch(map, squad, tick)
|
||||
elseif (squad.commandTick and (squad.commandTick < tick)) then
|
||||
local cmd = map.universe.wander2Command
|
||||
squad.commandTick = tick + COMMAND_TIMEOUT
|
||||
group.set_command(cmd)
|
||||
group.start_moving()
|
||||
if squad.wanders > 5 then
|
||||
squad.group.destroy()
|
||||
else
|
||||
squad.wanders = squad.wanders + 1
|
||||
local cmd = map.universe.wander2Command
|
||||
squad.commandTick = tick + COMMAND_TIMEOUT
|
||||
group.set_command(cmd)
|
||||
group.start_moving()
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -83,6 +83,7 @@ function unitGroupUtils.createSquad(position, surface, group, settlers)
|
||||
penalties = {},
|
||||
base = nil,
|
||||
frenzy = false,
|
||||
wanders = 0,
|
||||
settlers = settlers or false,
|
||||
kamikaze = false,
|
||||
frenzyPosition = {x = 0,
|
||||
|
Loading…
x
Reference in New Issue
Block a user