diff --git a/src/lib/commands/sinf.c b/src/lib/commands/sinf.c index 77219c61..96ff8716 100644 --- a/src/lib/commands/sinf.c +++ b/src/lib/commands/sinf.c @@ -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); +}