]> git.pond.sub.org Git - empserver/blobdiff - src/lib/commands/load.c
Update copyright notice
[empserver] / src / lib / commands / load.c
index 015b0836357c0fdf7a4701f5c3cd51a4be6eba83..fd94d00153c296e35bd3248f516a7b3052f2562a 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2006, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *  Copyright (C) 1986-2008, Dave Pare, Jeff Bailey, Thomas Ruschak,
  *                           Ken Stevens, Steve McClure
  *
  *  This program is free software; you can redistribute it and/or modify
 
 #include <config.h>
 
-#include <string.h>
-#include "misc.h"
-#include "player.h"
-#include "xy.h"
-#include "file.h"
-#include "plague.h"
-#include "sect.h"
-#include "ship.h"
-#include "plane.h"
-#include "land.h"
+#include <ctype.h>
+#include "commands.h"
+#include "empobj.h"
 #include "item.h"
-#include "nsc.h"
-#include "nat.h"
+#include "land.h"
 #include "optlist.h"
-#include "commands.h"
+#include "plague.h"
+#include "plane.h"
+#include "ship.h"
 
 /*
  * The values 1 and -1 are important below, don't change them.
@@ -84,8 +78,8 @@ load(void)
     struct sctstr sect;
     struct shpstr ship;
     int retval;
-    s_char *p;
-    s_char buf[1024];
+    char *p;
+    char buf[1024];
 
     if (!(p = getstarg(player->argp[1],
                       "What commodity (or 'plane' or 'land')? ", buf))
@@ -121,7 +115,7 @@ load(void)
            continue;
        }
        if (opt_MARKET) {
-           if (ontradingblock(EF_SHIP, (int *)&ship)) {
+           if (ontradingblock(EF_SHIP, &ship)) {
                pr("You cannot load/unload an item on the trading block!\n");
                continue;
            }
@@ -151,11 +145,8 @@ load(void)
        }
        if (!sect_has_dock(&sect)) {
            if (noisy)
-               pr("Sector %s is not a harbor%s%s.\n",
-                  xyas(ship.shp_x, ship.shp_y, player->cnum),
-                  dchr[SCT_CAPIT].d_nav == NAV_CANAL ? " or a " : "",
-                  dchr[SCT_CAPIT].d_nav == NAV_CANAL ?
-                   dchr[SCT_CAPIT].d_name : "");
+               pr("Sector %s is not a harbor or canal.\n",
+                  xyas(ship.shp_x, ship.shp_y, player->cnum));
            continue;
        }
        if (sect.sct_own != player->cnum && load_unload == UNLOAD
@@ -223,8 +214,8 @@ lload(void)
     struct sctstr sect;
     struct lndstr land;
     int retval;
-    s_char *p;
-    s_char buf[1024];
+    char *p;
+    char buf[1024];
 
     if (!(p = getstarg(player->argp[1],
                       "What commodity (or 'plane' or 'land')? ", buf))
@@ -249,7 +240,7 @@ lload(void)
     if (!snxtitem(&nbst, EF_LAND, p))
        return RET_SYN;
 
-    load_unload = *(*player->argp + 1) == 'l' ? LOAD : UNLOAD;
+    load_unload = player->argp[0][1] == 'l' ? LOAD : UNLOAD;
 
     nunits = 0;
     while (nxtitem(&nbst, &land)) {
@@ -266,7 +257,7 @@ lload(void)
        if (sect.sct_own != player->cnum && land.lnd_own != player->cnum)
            continue;
        if (opt_MARKET) {
-           if (ontradingblock(EF_LAND, (int *)&land)) {
+           if (ontradingblock(EF_LAND, &land)) {
                pr("You cannot load/unload an item on the trading block!\n");
                continue;
            }
@@ -319,31 +310,16 @@ lload(void)
 }
 
 void
-gift(int givee, int giver, s_char *ptr, int type, s_char *mesg)
+gift(natid givee, natid giver, void *ptr, char *mesg)
 {
-    s_char *p, line[256];
-
-    if (giver == givee)
-       return;
-
-
-    switch (type) {
-    case EF_SHIP:
-       p = prship((struct shpstr *)ptr);
-       break;
-    case EF_PLANE:
-       p = prplane((struct plnstr *)ptr);
-       break;
-    case EF_LAND:
-       p = prland((struct lndstr *)ptr);
-       break;
-    default:
-       CANT_HAPPEN("bad TYPE");
-       p = "a red herring";
-    }
+    struct empobj *gen = ptr;
+
+    if (giver != givee)
+       wu(0, givee, "%s %s %s\n", cname(giver), obj_nameof(gen), mesg);
 
-    sprintf(line, "%s %s %s\n", cname(giver), p, mesg);
-    wu(0, givee, line);
+    makelost(gen->ef_type, gen->own, gen->uid, gen->x, gen->y);
+    gen->own = givee;
+    makenotlost(gen->ef_type, gen->own, gen->uid, gen->x, gen->y);
 }
 
 static int
@@ -373,12 +349,12 @@ load_plane_ship(struct sctstr *sectp, struct shpstr *sp, int noisy,
     struct nstr_item ni;
     struct plnstr pln;
     int loaded = 0;
-    s_char buf[1024];
-    s_char *p;
-    s_char prompt[512];
+    char buf[1024];
+    char *p;
+    char prompt[512];
     struct mchrstr *mcp = mchr + sp->shp_type;
 
-    if (!(mcp->m_flags & (M_CHOPPER | M_XLIGHT | M_FLY | M_MSL))) {
+    if (mcp->m_nplanes + mcp->m_nchoppers + mcp->m_nxlight == 0) {
        if (noisy)
            pr("%s cannot carry planes\n", prship(sp));
        return 0;
@@ -401,8 +377,8 @@ load_plane_ship(struct sctstr *sectp, struct shpstr *sp, int noisy,
     if (!still_ok_ship(sectp, sp))
        return RET_SYN;
 
-    if (p && *p)
-       noisy &= isdigit(*p);
+    if (noisy && p && *p)
+       noisy = isdigit(*p);
 
     while (nxtitem(&ni, &pln)) {
        if (pln.pln_own != player->cnum)
@@ -438,7 +414,7 @@ load_plane_ship(struct sctstr *sectp, struct shpstr *sp, int noisy,
            continue;
 
        /* ship to (plane or missle) sanity */
-       if (!can_be_on_ship(pln.pln_uid, sp->shp_uid)) {
+       if (!could_be_on_ship(&pln, sp)) {
            if (plchr[(int)pln.pln_type].pl_flags & P_L) {
                strcpy(buf, "planes");
            } else if (plchr[(int)pln.pln_type].pl_flags & P_K) {
@@ -461,31 +437,15 @@ load_plane_ship(struct sctstr *sectp, struct shpstr *sp, int noisy,
            }
            sprintf(buf, "loaded on your %s at %s",
                    prship(sp), xyas(sp->shp_x, sp->shp_y, sp->shp_own));
-           gift(sp->shp_own, player->cnum, (s_char *)&pln, EF_PLANE, buf);
-           makelost(EF_PLANE, pln.pln_own, pln.pln_uid, pln.pln_x,
-                    pln.pln_y);
-           pln.pln_own = sp->shp_own;
-           makenotlost(EF_PLANE, pln.pln_own, pln.pln_uid, pln.pln_x,
-                       pln.pln_y);
+           gift(sp->shp_own, player->cnum, &pln, buf);
            pln.pln_mission = 0;
            putplane(pln.pln_uid, &pln);
        } else {
-           if (!take_plane_off_ship(&pln, sp)) {
-               pr("Unable to take plane off ship!\n");
-               logerror("load: plane %d could not be taken off ship %d\n",
-                        pln.pln_uid, sp->shp_uid);
-               continue;
-           }
+           take_plane_off_ship(&pln, sp);
            sprintf(buf, "unloaded in your %s at %s",
                    dchr[sectp->sct_type].d_name,
                    xyas(sectp->sct_x, sectp->sct_y, sectp->sct_own));
-           gift(sectp->sct_own, player->cnum, (s_char *)&pln,
-                EF_PLANE, buf);
-           makelost(EF_PLANE, pln.pln_own, pln.pln_uid, pln.pln_x,
-                    pln.pln_y);
-           pln.pln_own = sectp->sct_own;
-           makenotlost(EF_PLANE, pln.pln_own, pln.pln_uid, pln.pln_x,
-                       pln.pln_y);
+           gift(sectp->sct_own, player->cnum, &pln, buf);
            putplane(pln.pln_uid, &pln);
        }
        pr("%s %s %s at %s.\n",
@@ -507,9 +467,9 @@ load_land_ship(struct sctstr *sectp, struct shpstr *sp, int noisy,
     struct lndstr land;
     struct plnstr plane;
     int loaded = 0;
-    s_char *p;
-    s_char prompt[512];
-    s_char buf[1024];
+    char *p;
+    char prompt[512];
+    char buf[1024];
     int load_spy = 0;
 
     count_units(sp);
@@ -546,8 +506,8 @@ load_land_ship(struct sctstr *sectp, struct shpstr *sp, int noisy,
     if (!still_ok_ship(sectp, sp))
        return RET_SYN;
 
-    if (p && *p)
-       noisy &= isdigit(*p);
+    if (noisy && p && *p)
+       noisy = isdigit(*p);
 
     while (nxtitem(&ni, &land)) {
        if (land.lnd_own != player->cnum)
@@ -624,7 +584,8 @@ load_land_ship(struct sctstr *sectp, struct shpstr *sp, int noisy,
                (sp->shp_nland >= mchr[(int)sp->shp_type].m_nland)) {
                if (noisy) {
                    if (mchr[(int)sp->shp_type].m_nland)
-                       pr("%s doesn't have room for any more land units!\n", prship(sp));
+                       pr("%s doesn't have room for any more land units!\n",
+                          prship(sp));
                    else
                        pr("%s cannot carry land units!\n", prship(sp));
                }
@@ -632,12 +593,7 @@ load_land_ship(struct sctstr *sectp, struct shpstr *sp, int noisy,
            }
            sprintf(buf, "loaded on your %s at %s",
                    prship(sp), xyas(sp->shp_x, sp->shp_y, sp->shp_own));
-           gift(sp->shp_own, player->cnum, (s_char *)&land, EF_LAND, buf);
-           makelost(EF_LAND, land.lnd_own, land.lnd_uid, land.lnd_x,
-                    land.lnd_y);
-           land.lnd_own = sp->shp_own;
-           makenotlost(EF_LAND, land.lnd_own, land.lnd_uid, land.lnd_x,
-                       land.lnd_y);
+           gift(sp->shp_own, player->cnum, &land, buf);
            land.lnd_ship = sp->shp_uid;
            land.lnd_harden = 0;
            land.lnd_mission = 0;
@@ -654,13 +610,7 @@ load_land_ship(struct sctstr *sectp, struct shpstr *sp, int noisy,
                if (plane.pln_land != land.lnd_uid)
                    continue;
                sprintf(buf, "loaded on %s", prship(sp));
-               gift(sp->shp_own, player->cnum, (s_char *)&plane,
-                    EF_PLANE, buf);
-               makelost(EF_PLANE, plane.pln_own, plane.pln_uid,
-                        plane.pln_x, plane.pln_y);
-               plane.pln_own = sp->shp_own;
-               makenotlost(EF_PLANE, plane.pln_own, plane.pln_uid,
-                           plane.pln_x, plane.pln_y);
+               gift(sp->shp_own, player->cnum, &plane, buf);
                plane.pln_mission = 0;
                putplane(plane.pln_uid, &plane);
            }
@@ -670,16 +620,8 @@ load_land_ship(struct sctstr *sectp, struct shpstr *sp, int noisy,
                    xyas(sectp->sct_x, sectp->sct_y, sectp->sct_own));
 
            /* Spies are unloaded quietly, others aren't */
-           if (!(lchr[(int)land.lnd_type].l_flags & L_SPY)) {
-               gift(sectp->sct_own, player->cnum, (s_char *)&land,
-                    EF_LAND, buf);
-               makelost(EF_LAND, land.lnd_own, land.lnd_uid,
-                        land.lnd_x, land.lnd_y);
-               land.lnd_own = sectp->sct_own;
-               makenotlost(EF_LAND, land.lnd_own, land.lnd_uid,
-                           land.lnd_x, land.lnd_y);
-           }
-
+           if (!(lchr[(int)land.lnd_type].l_flags & L_SPY))
+               gift(sectp->sct_own, player->cnum, &land, buf);
            land.lnd_ship = -1;
            sp->shp_nland--;
            putland(land.lnd_uid, &land);
@@ -698,13 +640,7 @@ load_land_ship(struct sctstr *sectp, struct shpstr *sp, int noisy,
                    sprintf(buf, "unloaded at %s",
                            xyas(plane.pln_x, plane.pln_y,
                                 sectp->sct_own));
-                   gift(sectp->sct_own, player->cnum, (s_char *)&plane,
-                        EF_PLANE, buf);
-                   makelost(EF_PLANE, plane.pln_own, plane.pln_uid,
-                            plane.pln_x, plane.pln_y);
-                   plane.pln_own = sectp->sct_own;
-                   makenotlost(EF_PLANE, plane.pln_own, plane.pln_uid,
-                               plane.pln_x, plane.pln_y);
+                   gift(sectp->sct_own, player->cnum, &plane, buf);
                    plane.pln_mission = 0;
                    putplane(plane.pln_uid, &plane);
                }
@@ -729,9 +665,9 @@ load_comm_ship(struct sctstr *sectp, struct shpstr *sp,
     struct mchrstr *mcp = &mchr[(int)sp->shp_type];
     int ship_amt, ship_max, sect_amt, move_amt;
     int amount;
-    s_char prompt[512];
-    s_char *p;
-    s_char buf[1024];
+    char prompt[512];
+    char *p;
+    char buf[1024];
 
     sprintf(prompt, "Number of %s to %s %s at %s? ",
            ich->i_name,
@@ -778,33 +714,24 @@ load_comm_ship(struct sctstr *sectp, struct shpstr *sp,
     sp->shp_item[item] = ship_amt + move_amt;
     if (move_amt >= 0) {
        pr("%d %s loaded onto %s at %s\n",
-          move_amt,
-          ich->i_name,
+          move_amt, ich->i_name,
           prship(sp), xyas(sp->shp_x, sp->shp_y, player->cnum));
        if (sp->shp_own != player->cnum) {
-           sprintf(buf, "%s loaded %d %s onto %s at %s\n",
-                   cname(player->cnum),
-                   move_amt,
-                   ich->i_name,
-                   prship(sp), xyas(sp->shp_x, sp->shp_y, sp->shp_own));
-           wu(0, sp->shp_own, buf);
+           wu(0, sp->shp_own, "%s loaded %d %s onto %s at %s\n",
+              cname(player->cnum), move_amt, ich->i_name,
+              prship(sp), xyas(sp->shp_x, sp->shp_y, sp->shp_own));
        }
     } else {
        pr("%d %s unloaded from %s at %s\n",
-          -move_amt,
-          ich->i_name,
+          -move_amt, ich->i_name,
           prship(sp), xyas(sp->shp_x, sp->shp_y, player->cnum));
        if (sectp->sct_own != player->cnum) {
-           sprintf(buf, "%s unloaded %d %s from %s at %s\n",
-                   cname(player->cnum),
-                   -move_amt,
-                   ich->i_name,
-                   prship(sp),
-                   xyas(sp->shp_x, sp->shp_y, sectp->sct_own));
-           wu(0, sectp->sct_own, buf);
+           wu(0, sectp->sct_own, "%s unloaded %d %s from %s at %s\n",
+              cname(player->cnum), -move_amt, ich->i_name,
+              prship(sp), xyas(sp->shp_x, sp->shp_y, sectp->sct_own));
        }
     }
-    ++(*nshipsp);
+    ++*nshipsp;
     return 0;
 }
 
@@ -815,9 +742,9 @@ load_plane_land(struct sctstr *sectp, struct lndstr *lp, int noisy,
     struct nstr_item ni;
     struct plnstr pln;
     int loaded = 0;
-    s_char *p;
-    s_char prompt[512];
-    s_char buf[1024];
+    char *p;
+    char prompt[512];
+    char buf[1024];
 
     if (!lp->lnd_maxlight) {
        if (noisy)
@@ -840,8 +767,8 @@ load_plane_land(struct sctstr *sectp, struct lndstr *lp, int noisy,
     if (!still_ok_land(sectp, lp))
        return RET_SYN;
 
-    if (p && *p)
-       noisy &= isdigit(*p);
+    if (noisy && p && *p)
+       noisy = isdigit(*p);
 
     if (sectp->sct_own != player->cnum && load_unload == LOAD) {
        pr("Sector %s is not yours.\n",
@@ -888,29 +815,13 @@ load_plane_land(struct sctstr *sectp, struct lndstr *lp, int noisy,
            }
            sprintf(buf, "loaded on %s at %s",
                    prland(lp), xyas(lp->lnd_x, lp->lnd_y, lp->lnd_own));
-           gift(lp->lnd_own, player->cnum, (s_char *)&pln, EF_PLANE, buf);
-           makelost(EF_PLANE, pln.pln_own, pln.pln_uid, pln.pln_x,
-                    pln.pln_y);
-           pln.pln_own = lp->lnd_own;
-           makenotlost(EF_PLANE, pln.pln_own, pln.pln_uid, pln.pln_x,
-                       pln.pln_y);
+           gift(lp->lnd_own, player->cnum, &pln, buf);
            putplane(pln.pln_uid, &pln);
        } else {
-           if (!take_plane_off_land(&pln, lp)) {
-               pr("Unable to take plane off unit!\n");
-               logerror("load: plane %d could not be taken off unit %d\n",
-                        pln.pln_uid, lp->lnd_uid);
-               continue;
-           }
+           take_plane_off_land(&pln, lp);
            sprintf(buf, "unloaded at your sector at %s",
                    xyas(sectp->sct_x, sectp->sct_y, sectp->sct_own));
-           gift(sectp->sct_own, player->cnum, (s_char *)&pln,
-                EF_PLANE, buf);
-           makelost(EF_PLANE, pln.pln_own, pln.pln_uid, pln.pln_x,
-                    pln.pln_y);
-           pln.pln_own = sectp->sct_own;
-           makenotlost(EF_PLANE, pln.pln_own, pln.pln_uid, pln.pln_x,
-                       pln.pln_y);
+           gift(sectp->sct_own, player->cnum, &pln, buf);
            putplane(pln.pln_uid, &pln);
        }
        pr("%s %s %s at %s.\n",
@@ -932,9 +843,9 @@ load_comm_land(struct sctstr *sectp, struct lndstr *lp,
     struct lchrstr *lcp = &lchr[(int)lp->lnd_type];
     int land_amt, land_max, sect_amt, move_amt;
     int amount;
-    s_char prompt[512];
-    s_char *p;
-    s_char buf[1024];
+    char prompt[512];
+    char *p;
+    char buf[1024];
 
     sprintf(prompt, "Number of %s to %s %s at %s? ",
            ich->i_name,
@@ -985,33 +896,24 @@ load_comm_land(struct sctstr *sectp, struct lndstr *lp,
        lp->lnd_harden = 0;
     if (move_amt >= 0) {
        pr("%d %s loaded onto %s at %s\n",
-          move_amt,
-          ich->i_name,
+          move_amt, ich->i_name,
           prland(lp), xyas(lp->lnd_x, lp->lnd_y, player->cnum));
        if (lp->lnd_own != player->cnum) {
-           sprintf(buf, "%s loaded %d %s onto %s at %s\n",
-                   cname(player->cnum),
-                   move_amt,
-                   ich->i_name,
-                   prland(lp), xyas(lp->lnd_x, lp->lnd_y, lp->lnd_own));
-           wu(0, lp->lnd_own, buf);
+           wu(0, lp->lnd_own, "%s loaded %d %s onto %s at %s\n",
+              cname(player->cnum), move_amt, ich->i_name,
+              prland(lp), xyas(lp->lnd_x, lp->lnd_y, lp->lnd_own));
        }
     } else {
        pr("%d %s unloaded from %s at %s\n",
-          -move_amt,
-          ich->i_name,
+          -move_amt, ich->i_name,
           prland(lp), xyas(lp->lnd_x, lp->lnd_y, player->cnum));
        if (sectp->sct_own != player->cnum) {
-           sprintf(buf, "%s unloaded %d %s from %s at %s\n",
-                   cname(player->cnum),
-                   -move_amt,
-                   ich->i_name,
-                   prland(lp),
-                   xyas(lp->lnd_x, lp->lnd_y, sectp->sct_own));
-           wu(0, sectp->sct_own, buf);
+           wu(0, sectp->sct_own, "%s unloaded %d %s from %s at %s\n",
+              cname(player->cnum), -move_amt, ich->i_name,
+              prland(lp), xyas(lp->lnd_x, lp->lnd_y, sectp->sct_own));
        }
     }
-    ++(*nunitsp);
+    ++*nunitsp;
     return 0;
 }
 
@@ -1023,9 +925,9 @@ load_land_land(struct sctstr *sectp, struct lndstr *lp, int noisy,
     struct lndstr land;
     struct plnstr plane;
     int loaded = 0;
-    s_char *p;
-    s_char prompt[512];
-    s_char buf[1024];
+    char *p;
+    char prompt[512];
+    char buf[1024];
 
     lnd_count_units(lp);
 
@@ -1048,8 +950,8 @@ load_land_land(struct sctstr *sectp, struct lndstr *lp, int noisy,
     if (!still_ok_land(sectp, lp))
        return RET_SYN;
 
-    if (p && *p)
-       noisy &= isdigit(*p);
+    if (noisy && p && *p)
+       noisy = isdigit(*p);
 
     while (nxtitem(&ni, &land)) {
 
@@ -1104,7 +1006,8 @@ load_land_land(struct sctstr *sectp, struct lndstr *lp, int noisy,
            if (lp->lnd_nland >= lp->lnd_maxland) {
                if (noisy) {
                    if (lp->lnd_nland)
-                       pr("%s doesn't have room for any more land units!\n", prland(lp));
+                       pr("%s doesn't have room for any more land units!\n",
+                          prland(lp));
                    else
                        pr("%s cannot carry land units!\n", prland(lp));
                }
@@ -1112,12 +1015,7 @@ load_land_land(struct sctstr *sectp, struct lndstr *lp, int noisy,
            }
            sprintf(buf, "loaded on your %s at %s",
                    prland(lp), xyas(lp->lnd_x, lp->lnd_y, lp->lnd_own));
-           gift(lp->lnd_own, player->cnum, (s_char *)&land, EF_LAND, buf);
-           makelost(EF_LAND, land.lnd_own, land.lnd_uid, land.lnd_x,
-                    land.lnd_y);
-           land.lnd_own = lp->lnd_own;
-           makenotlost(EF_LAND, land.lnd_own, land.lnd_uid, land.lnd_x,
-                       land.lnd_y);
+           gift(lp->lnd_own, player->cnum, &land, buf);
            land.lnd_land = lp->lnd_uid;
            land.lnd_harden = 0;
            land.lnd_mission = 0;
@@ -1134,13 +1032,7 @@ load_land_land(struct sctstr *sectp, struct lndstr *lp, int noisy,
                if (plane.pln_land != land.lnd_uid)
                    continue;
                sprintf(buf, "loaded on %s", prland(lp));
-               gift(lp->lnd_own, player->cnum, (s_char *)&plane,
-                    EF_PLANE, buf);
-               makelost(EF_PLANE, plane.pln_own, plane.pln_uid,
-                        plane.pln_x, plane.pln_y);
-               plane.pln_own = lp->lnd_own;
-               makenotlost(EF_PLANE, plane.pln_own, plane.pln_uid,
-                           plane.pln_x, plane.pln_y);
+               gift(lp->lnd_own, player->cnum, &plane, buf);
                plane.pln_mission = 0;
                putplane(plane.pln_uid, &plane);
            }
@@ -1148,13 +1040,7 @@ load_land_land(struct sctstr *sectp, struct lndstr *lp, int noisy,
            sprintf(buf, "unloaded in your %s at %s",
                    dchr[sectp->sct_type].d_name,
                    xyas(sectp->sct_x, sectp->sct_y, sectp->sct_own));
-           gift(sectp->sct_own, player->cnum, (s_char *)&land,
-                EF_LAND, buf);
-           makelost(EF_LAND, land.lnd_own, land.lnd_uid, land.lnd_x,
-                    land.lnd_y);
-           land.lnd_own = sectp->sct_own;
-           makenotlost(EF_LAND, land.lnd_own, land.lnd_uid, land.lnd_x,
-                       land.lnd_y);
+           gift(sectp->sct_own, player->cnum, &land, buf);
            land.lnd_land = -1;
            lp->lnd_nland--;
            putland(land.lnd_uid, &land);
@@ -1167,13 +1053,7 @@ load_land_land(struct sctstr *sectp, struct lndstr *lp, int noisy,
                    continue;
                sprintf(buf, "unloaded at %s",
                        xyas(plane.pln_x, plane.pln_y, sectp->sct_own));
-               gift(sectp->sct_own, player->cnum, (s_char *)&plane,
-                    EF_PLANE, buf);
-               makelost(EF_PLANE, plane.pln_own, plane.pln_uid,
-                        plane.pln_x, plane.pln_y);
-               plane.pln_own = sectp->sct_own;
-               makenotlost(EF_PLANE, plane.pln_own, plane.pln_uid,
-                           plane.pln_x, plane.pln_y);
+               gift(sectp->sct_own, player->cnum, &plane, buf);
                plane.pln_mission = 0;
                putplane(plane.pln_uid, &plane);
            }