Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Actions.UnitKill and invalid groups #20

Open
Kistrel opened this issue Mar 31, 2015 · 2 comments
Open

Bug: Actions.UnitKill and invalid groups #20

Kistrel opened this issue Mar 31, 2015 · 2 comments

Comments

@Kistrel
Copy link

Kistrel commented Mar 31, 2015

Using Actions.UnitKill on a newly equipped Warrior before he joined a group creates an invalid group that exists and is alive, but has 0 members and is hungry.

@Kromster80
Copy link
Owner

Please describe the algorithm of reproducing this bug, in steps.

@Kistrel
Copy link
Author

Kistrel commented Mar 31, 2015

Create a map in the editor, with a Barracks stocked with recruits and axes.
Attach the following script, then start a game on the map and recruit a Militia.

procedure OnTick;
var
  aUnits: array of Integer;
  i: Integer;
begin
  if States.StatUnitTypeCount(0, 14) > 0 then begin
    aUnits := States.PlayerGetAllUnits(0);
    for i := 0 to Length(aUnits)-1 do if States.UnitType(aUnits[i]) = 14 then
      Actions.UnitKill(aUnits[i], True);
  end;
end;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants