]> git.pond.sub.org Git - empserver/commitdiff
Fix show sect b not to omit undesignatable sectors
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 21 Feb 2009 14:59:36 +0000 (15:59 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 19 Jul 2009 17:52:55 +0000 (13:52 -0400)
show sect b needs to explain any sector players can build.
show_sect_build() omitted sectors players can't designate.  That's
wrong, because players can certainly own and thus build sectors they
can't designate.  Test for infinite mobility cost instead, like
show_sect_stats().

src/lib/subs/show.c

index c39e1b66566eec73e269044bd1f6824fb6939e94..7c484f6c81df1b8e364e5a192deadca6d2f22cd2 100644 (file)
@@ -464,14 +464,14 @@ show_sect_build(int foo)
     for (i = 0; dchr[i].d_name; i++) {
        if (dchr[i].d_mnem == 0)
            continue;
-       if (dchr[i].d_cost < 0)
+       if (dchr[i].d_mob0 < 0)
            continue;
-       if ((dchr[i].d_cost > 0) || (dchr[i].d_build != 1) ||
-           (dchr[i].d_lcms > 0) || (dchr[i].d_hcms > 0)) {
-           pr("%-14c %-14d %-17d %-14d %d\n",
-              dchr[i].d_mnem, dchr[i].d_cost, dchr[i].d_build,
-              dchr[i].d_lcms, dchr[i].d_hcms);
-       }
+       if (dchr[i].d_cost <= 0 && dchr[i].d_build == 1
+           && dchr[i].d_lcms == 0 && dchr[i].d_hcms == 0)
+           continue;           /* the usual, skip */
+       pr("%-14c %-14d %-17d %-14d %d\n",
+          dchr[i].d_mnem, dchr[i].d_cost, dchr[i].d_build,
+          dchr[i].d_lcms, dchr[i].d_hcms);
     }
     pr("other          0              1                 0              0\n");