(landmine): Add a missing call of putland(). Closes #682570. Don't

complain about running out of things when the job actually completed
fine.  From Marc Olzheim.
This commit is contained in:
Markus Armbruster 2004-02-05 16:03:59 +00:00
parent aba72ef569
commit b36eaf98d3

View file

@ -123,6 +123,7 @@ landmine(void)
continue; continue;
} }
resupply_commod(&land, I_SHELL); resupply_commod(&land, I_SHELL);
putland(land.lnd_uid, &land);
if (!(shells = getvar(V_SHELL, (s_char *)&land, EF_LAND))) if (!(shells = getvar(V_SHELL, (s_char *)&land, EF_LAND)))
continue; continue;
shells = min(shells, land.lnd_mobil); shells = min(shells, land.lnd_mobil);
@ -148,7 +149,7 @@ landmine(void)
putvar(V_SHELL, shells - mines_laid, (s_char *)&land, EF_LAND); putvar(V_SHELL, shells - mines_laid, (s_char *)&land, EF_LAND);
land.lnd_mobil -= mines_laid; land.lnd_mobil -= mines_laid;
putland(land.lnd_uid, &land); putland(land.lnd_uid, &land);
resupply_commod(&land, I_SHELL); resupply_commod(&land, I_SHELL); /* Get more shells */
putland(land.lnd_uid, &land); putland(land.lnd_uid, &land);
total_mines_laid += mines_laid; total_mines_laid += mines_laid;
shells = getvar(V_SHELL, (s_char *)&land, EF_LAND); shells = getvar(V_SHELL, (s_char *)&land, EF_LAND);
@ -158,11 +159,15 @@ landmine(void)
putvar(V_MINE, total_mines_laid + mines_there, (s_char *)&sect, putvar(V_MINE, total_mines_laid + mines_there, (s_char *)&sect,
EF_SECTOR); EF_SECTOR);
putsect(&sect); putsect(&sect);
if (shells) if (total_mines_laid == mines_wanted) {
pr("%s laid a total of %d mines in %s\n", pr("%s laid a total of %d mines in %s",
prland(&land), total_mines_laid, prland(&land), total_mines_laid,
xyas(sect.sct_x, sect.sct_y, land.lnd_own)); xyas(sect.sct_x, sect.sct_y, land.lnd_own));
if (!shells)
pr(" but is now out of supply\n");
else else
pr("\n");
} else
pr("%s ran out of %s before it could finish the job\nOnly %d mines were laid in %s\n", prland(&land), land.lnd_mobil > 0 ? "supply" : "mobility", total_mines_laid, xyas(sect.sct_x, sect.sct_y, land.lnd_own)); pr("%s ran out of %s before it could finish the job\nOnly %d mines were laid in %s\n", prland(&land), land.lnd_mobil > 0 ? "supply" : "mobility", total_mines_laid, xyas(sect.sct_x, sect.sct_y, land.lnd_own));
} }
return RET_OK; return RET_OK;