Fix navigate and march not to prompt for number of mines to lay
When sub-command 'd' was used without arguments, do_unit_move() failed to supply the second argument to mine(), which duly prompted for it. This contracticted info, and could trigger a generation oops. do_unit_move() reads the ships into a list. It re-reads them when it prompts for sub-commands. shp_nav_one_sector() writes them back when it moves ships. The mine prompt made the list stale. Movement sub-commands before the next prompt for sub-commands wrote back stale ships, triggering a generation oops. Example: "nav 15 dg". Broken when mine-laying was added in commits2438fe7c
, v4.3.7. Same for march, commit274c8e42
, v4.3.7.
This commit is contained in:
parent
fea24d10da
commit
45106ab91f
1 changed files with 2 additions and 2 deletions
|
@ -244,8 +244,8 @@ do_unit_move(struct emp_qelem *ulist, int *together,
|
||||||
skip = 1;
|
skip = 1;
|
||||||
continue;
|
continue;
|
||||||
case 'd':
|
case 'd':
|
||||||
if (ac == 2) {
|
if (ac < 3) {
|
||||||
player->argp[2] = player->argp[1];
|
player->argp[2] = ac < 2 ? "1" : player->argp[1];
|
||||||
sprintf(dp, "%d", leader->uid);
|
sprintf(dp, "%d", leader->uid);
|
||||||
player->argp[1] = dp;
|
player->argp[1] = dp;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue