Skip to content

Units can self-guard #6324

@Brian-Catcow-B

Description

@Brian-Catcow-B

Description

Some units can be issued a guard command on themselves, which, unless I'm mistaken, never makes sense to allow and can sometimes lead to unintended results (especially considering anything that can guard has it as the default command, though not all units that can guard can guard themselves). See the following example:

Image

In the above image we see that the player has told the razorback to move to the right with the first move command, then guard itself (probably meant to put a move command near where the razorback was at the time), then move down to the other move command. If we play it out, the razorback gets stuck in the following state:

Image

which is not ideal.

Expected Behaviour

  1. The guard command is simply disallowed on self for every unit

AND (maybe, though this is probably not required for a decent-enough implementation)

  1. When one unit is selected, mousing over itself will not make the default command guard, but instead move (if the unit has the flag canMove set)

Actual Behaviour

Certain units can guard themselves, leading to strange situations sometimes

Reproduction steps

Click a unit and right click itself (some work some don't, see next section).

Other

From my testing, it seems like units that can construct can't guard themselves, except for factories, which can guard themselves. Then everything else that can guard can guard itself.

Planes are weird in that they will start moving around somewhat randomly, but generally straight, if they are set to guard themselves.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions