Unit is to set to guard A and B. One would expect that if either A or B gets attacked, the unit will defend it.
But what actually happens is that it guards A then it guards B.
So if B is attacked the unit will not defend it because it is still busy guarding A. Only once A is destroyed will the unit care about B.
Similiar with constructors set to guard multiple other cons or factories. If the first con/factory is idle it will just stare at it instead of helping the next unit in queue.
Fix might be a wupget that whenever a unit was damaged, checks if some unit was supposed to guarding it. If yes, that attacked unit is moved to first place in guard queue of the guarding unit.
---
There already is AllowCommand() and CMDTYPE.ICON_UNIT_OR_AREA so no need to re-invent it.Jools wrote:Yes, I was thinking to have it in mousepress and mousedrag. Why is that bad? You cannot issue a guard order without clicking.Google_Frog wrote:Click detection is to be avoided.
http://code.google.com/p/zero-k/source/ ... ard.lua#77
local units = Spring.GetUnitsInSphere( unpack(cmdParams) )
Why not GetUnitsInCylinder? In case of mountains!