]> git.pond.sub.org Git - empserver/commitdiff
Fix scrap and scuttle output when there's output about cargo
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 13 Sep 2008 13:45:26 +0000 (09:45 -0400)
committerMarkus Armbruster <armbru@pond.sub.org>
Mon, 15 Sep 2008 11:49:24 +0000 (07:49 -0400)
scra() and scut() printed their "scrapped in" / "scuttled in" message
in two parts.  Messages for scrapped / scuttled cargo were printed
between the parts.  Fix by printing in one go, after the cargo
messages.

src/lib/commands/scra.c
src/lib/commands/scut.c

index 340e37a1dfbf9406f7678936b42ddcd389d4c7bf..ccf4ecfa7a13b0b97337e851c84463104fc37cd3 100644 (file)
@@ -171,7 +171,6 @@ scra(void)
                    }
                }
            }
-           pr("%s", prship(&item.ship));
            for (i = I_NONE + 1; i <= I_MAX; i++) {
                sect.sct_item[i] += item.ship.shp_item[i];
            }
@@ -219,7 +218,6 @@ scra(void)
        } else if (type == EF_LAND) {
            eff = item.land.lnd_effic / 100.0;
            lp = &lchr[(int)item.land.lnd_type];
-           pr("%s", prland(&item.land));
            for (i = I_NONE + 1; i <= I_MAX; i++) {
                sect.sct_item[i] += item.land.lnd_item[i];
            }
@@ -269,15 +267,15 @@ scra(void)
        } else {
            eff = item.land.lnd_effic / 100.0;
            pp = &plchr[(int)item.plane.pln_type];
-           pr("%s", prplane(&item.plane));
            sect.sct_item[I_LCM] += pp->pl_lcm * 2 / 3 * eff;
            sect.sct_item[I_HCM] += pp->pl_hcm * 2 / 3 * eff;
            sect.sct_item[I_MILIT] += pp->pl_crew;
            item.plane.pln_effic = 0;
            putplane(item.plane.pln_uid, &item.plane);
        }
-       pr(" scrapped in %s\n",
-          xyas(sect.sct_x, sect.sct_y, player->cnum));
+       pr("%s scrapped in %s\n",
+          obj_nameof(&item.gen),
+          xyas(item.gen.x, item.gen.y, player->cnum));
        for (i = I_NONE + 1; i <= I_MAX; i++) {
            if (sect.sct_item[i] > ITEM_MAX)
                sect.sct_item[i] = ITEM_MAX;
index 7c6b45927e18671f9a3ccd73141fb1824ab068fd..8d5428322285386ba1832f56ce34711ffa060194 100644 (file)
@@ -131,7 +131,6 @@ scut(void)
                    if (!scuttle_tradeship(&item.ship, 1))
                        continue;
            }
-           pr("%s", prship(&item.ship));
            scuttle_ship(&item.ship);
        } else if (type == EF_LAND) {
            if (item.land.lnd_ship >= 0) {
@@ -139,15 +138,14 @@ scut(void)
                   prland(&item.land));
                continue;
            }
-           pr("%s", prland(&item.land));
            scuttle_land(&item.land);
        } else {
-           pr("%s", prplane(&item.plane));
            item.plane.pln_effic = 0;
            putplane(item.plane.pln_uid, &item.plane);
        }
-       pr(" scuttled in %s\n",
-          xyas(item.ship.shp_x, item.ship.shp_y, player->cnum));
+       pr("%s scuttled in %s\n",
+          obj_nameof(&item.gen),
+          xyas(item.gen.x, item.gen.y, player->cnum));
     }
 
     return RET_OK;