Skip to content

Commit

Permalink
Require the form alias to be strictly numeric
Browse files Browse the repository at this point in the history
Currently if you do
FORM 1a
END
FORM 1b
END

The checker accepts it but it doesn't work correctly as you end up with
errors about multiply defined aliases during the run.
  • Loading branch information
jt-traub committed Sep 18, 2024
1 parent 8970d40 commit 10734fd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion parseorders.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2724,12 +2724,16 @@ Unit *Game::ProcessFormOrder(Unit *former, AString *o, OrdersCheck *pCheck, int
return 0;
}

int an = t->value();
int an = t->strict_value();
delete t;
if (!an) {
parse_error(pCheck, former, 0, "Must give alias in FORM order.");
return 0;
}
if (an == -1) {
parse_error(pCheck, former, 0, "Invalid alias in FORM order.");
return 0;
}
if (pCheck) {
Unit *retval = new Unit;
retval->former = former;
Expand Down

0 comments on commit 10734fd

Please sign in to comment.