(prmobcost): New.
(sinfra): Use it to display inaccessible sectors sensibly. Inaccessible occurs for rail since src/lib/common/move.c rev. 1.12.
This commit is contained in:
parent
2ecc85b541
commit
89022fbc42
1 changed files with 15 additions and 2 deletions
|
@ -44,6 +44,8 @@
|
|||
#include "commands.h"
|
||||
#include "combat.h"
|
||||
|
||||
static void prmobcost(struct sctstr *, int);
|
||||
|
||||
int
|
||||
sinfra(void)
|
||||
{
|
||||
|
@ -76,9 +78,9 @@ sinfra(void)
|
|||
pr(" ");
|
||||
pr("%4d%% ", sect.sct_effic);
|
||||
pr("%4d%% ", sect.sct_road);
|
||||
pr("%4.3f ", sector_mcost(§, MOB_MOVE));
|
||||
prmobcost(§, MOB_MOVE);
|
||||
pr("%4d%% ", sect.sct_rail);
|
||||
pr("%4.3f ", sector_mcost(§, MOB_RAIL));
|
||||
prmobcost(§, MOB_RAIL);
|
||||
pr("%4d%% ", SCT_DEFENSE(§));
|
||||
pr("%5.2f\n", sector_strength(§));
|
||||
}
|
||||
|
@ -92,3 +94,14 @@ sinfra(void)
|
|||
pr("%d sector%s\n", nsect, splur(nsect));
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
prmobcost(struct sctstr *sp, int mobtype)
|
||||
{
|
||||
double cost = sector_mcost(sp, mobtype);
|
||||
|
||||
if (cost < 0)
|
||||
pr(" N/A ");
|
||||
else
|
||||
pr("%5.3f ", cost);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue