2 * Empire - A multi-player, client/server Internet based war game.
3 * Copyright (C) 1986-2018, Dave Pare, Jeff Bailey, Thomas Ruschak,
4 * Ken Stevens, Steve McClure, Markus Armbruster
6 * Empire is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
21 * See files README, COPYING and CREDITS in the root of the source
22 * tree for related information and legal notices. It is expected
23 * that future projects/authors will amend these files as needed.
27 * load.c: load/unload goods from a sector onto a ship or land unit
29 * Known contributors to this file:
30 * David Sharnoff, 1987
31 * Ken Stevens, 1995 (rewritten)
32 * Steve McClure, 1998-2000
33 * Markus Armbruster, 2004-2017
48 static int load_plane_ship(struct sctstr *sectp, struct shpstr *sp,
49 int noisy, int loading, int *nshipsp);
50 static int load_land_ship(struct sctstr *sectp, struct shpstr *sp,
51 int noisy, int loading, int *nshipsp);
52 static int load_comm_ship(struct sctstr *sectp, struct shpstr *sp,
53 struct ichrstr *ich, int loading,
55 static int load_plane_land(struct sctstr *sectp, struct lndstr *lp,
56 int noisy, int loading, int *nunitsp);
57 static int load_land_land(struct sctstr *sectp, struct lndstr *lp,
58 int noisy, int loading, int *nunitsp);
59 static int load_comm_land(struct sctstr *sectp, struct lndstr *lp,
60 struct ichrstr *ich, int loading,
66 int loading = **player->argp == 'l';
69 struct nstr_item nbst;
78 p = getstarg(player->argp[1],
79 "What commodity (or 'plane' or 'land')? ", buf);
83 if (!strncmp(p, "plane", 5))
85 else if (!strncmp(p, "land", 4))
87 else if (NULL != (ich = item_by_name(p)))
90 pr("Can't %sload '%s'\n", loading ? "" : "un", p);
94 p = getstarg(player->argp[2], "Ship(s): ", buf);
98 if (!snxtitem(&nbst, EF_SHIP, p, NULL))
101 noisy = nbst.sel == NS_LIST;
104 while (nxtitem(&nbst, &ship)) {
107 if (!player->owner) {
108 if (!loading || !noisy)
110 if (relations_with(ship.shp_own, player->cnum) < FRIENDLY)
114 if (!getsect(ship.shp_x, ship.shp_y, §)) /* XXX */
118 if (!player->owner) {
119 if (ship.shp_own != player->cnum)
121 if (!sect_has_dock(§))
125 pr("You don't own %s\n",
126 xyas(sect.sct_x, sect.sct_y, player->cnum));
130 if (!sect_has_dock(§)) {
132 pr("Sector %s is not a harbor or canal.\n",
133 xyas(sect.sct_x, sect.sct_y, player->cnum));
138 && relations_with(sect.sct_own, player->cnum) < FRIENDLY) {
140 pr("You can't unload into an unfriendly %s\n",
141 dchr[sect.sct_type].d_name);
144 if (sect.sct_effic < 2) {
146 pr("The %s at %s is not 2%% efficient yet.\n",
147 dchr[sect.sct_type].d_name,
148 xyas(sect.sct_x, sect.sct_y, player->cnum));
153 if (ontradingblock(EF_SHIP, &ship)) {
154 pr("You cannot load/unload an item on the trading block!\n");
161 retval = load_plane_ship(§, &ship, noisy, loading, &nships);
166 retval = load_land_ship(§, &ship, noisy, loading, &nships);
171 retval = load_comm_ship(§, &ship, ich, loading, &nships);
175 /* load/unload plague */
176 if (sect.sct_pstage == PLG_INFECT
177 && ship.shp_pstage == PLG_HEALTHY)
178 ship.shp_pstage = PLG_EXPOSED;
179 if (ship.shp_pstage == PLG_INFECT
180 && sect.sct_pstage == PLG_HEALTHY)
181 sect.sct_pstage = PLG_EXPOSED;
183 putship(ship.shp_uid, &ship);
186 pr("No ships affected\n");
188 pr("%d ship%s %sloaded\n", nships, splur(nships),
189 loading ? "" : "un");
196 int loading = player->argp[0][1] == 'l';
199 struct nstr_item nbst;
208 p = getstarg(player->argp[1],
209 "What commodity (or 'plane' or 'land')? ", buf);
212 if (!strncmp(p, "plane", 5))
214 else if (!strncmp(p, "land", 4))
216 else if (NULL != (ich = item_by_name(p)))
219 pr("Can't %sload '%s'\n", loading ? "" : "un", p);
223 p = getstarg(player->argp[2], "Unit(s): ", buf);
227 if (!snxtitem(&nbst, EF_LAND, p, NULL))
230 noisy = nbst.sel == NS_LIST;
233 while (nxtitem(&nbst, &land)) {
234 if (land.lnd_own == 0)
236 if (!player->owner) {
237 if (!loading || !noisy)
239 if (relations_with(land.lnd_own, player->cnum) != ALLIED)
243 if (!getsect(land.lnd_x, land.lnd_y, §)) /* XXX */
245 if (!player->owner) {
246 if (land.lnd_own != player->cnum)
250 pr("Sector %s is not yours.\n",
251 xyas(sect.sct_x, sect.sct_y, player->cnum));
254 if (relations_with(sect.sct_own, player->cnum) != ALLIED) {
255 pr("Sector %s is not yours.\n",
256 xyas(sect.sct_x, sect.sct_y, player->cnum));
262 if (ontradingblock(EF_LAND, &land)) {
263 pr("You cannot load/unload an item on the trading block!\n");
270 retval = load_land_land(§, &land, noisy, loading, &nunits);
275 retval = load_plane_land(§, &land, noisy, loading, &nunits);
280 retval = load_comm_land(§, &land, ich, loading, &nunits);
284 /* load/unload plague */
285 if (sect.sct_pstage == PLG_INFECT
286 && land.lnd_pstage == PLG_HEALTHY)
287 land.lnd_pstage = PLG_EXPOSED;
288 if (land.lnd_pstage == PLG_INFECT
289 && sect.sct_pstage == PLG_HEALTHY)
290 sect.sct_pstage = PLG_EXPOSED;
293 putland(land.lnd_uid, &land);
296 pr("No units affected\n");
298 pr("%d unit%s %sloaded\n", nunits, splur(nunits),
299 loading ? "" : "un");
304 move_amount(int sect_amt, int unit_amt, int unit_max,
305 int loading, int amount)
310 move_amt = -amount - unit_amt;
312 move_amt = loading ? amount : -amount;
313 move_amt = LIMIT_TO(move_amt, -unit_amt, unit_max - unit_amt);
314 move_amt = LIMIT_TO(move_amt, sect_amt - ITEM_MAX, sect_amt);
319 load_comm_ok(struct sctstr *sectp, natid unit_own,
320 i_type item, int move_amt)
324 if (move_amt < 0 && !player->god && unit_own != player->cnum)
326 if (move_amt > 0 && !player->god && sectp->sct_own != player->cnum)
328 if (sectp->sct_oldown != unit_own && item == I_CIVIL) {
329 pr("%s civilians refuse to %s at %s!\n",
330 (move_amt < 0 ? unit_own : sectp->sct_oldown) == player->cnum
331 ? "Your" : "Foreign",
332 move_amt < 0 ? "disembark" : "board",
333 xyas(sectp->sct_x, sectp->sct_y, player->cnum));
340 gift(natid givee, natid giver, void *ptr, char *mesg)
343 wu(0, givee, "%s %s %s\n", cname(giver), unit_nameof(ptr), mesg);
344 unit_give_away(ptr, givee, 0);
348 still_ok_ship(struct sctstr *sectp, struct shpstr *shipp)
350 if (!check_sect_ok(sectp))
352 if (!check_ship_ok(shipp))
358 still_ok_land(struct sctstr *sectp, struct lndstr *landp)
360 if (!check_sect_ok(sectp))
362 if (!check_land_ok(landp))
368 load_plane_ship(struct sctstr *sectp, struct shpstr *sp, int noisy,
369 int loading, int *nshipsp)
377 struct mchrstr *mcp = mchr + sp->shp_type;
379 if (mcp->m_nplanes + mcp->m_nchoppers + mcp->m_nxlight == 0) {
381 pr("%s cannot carry planes\n", prship(sp));
385 shp_nplane(sp, NULL, NULL, NULL)
386 >= mcp->m_nchoppers + mcp->m_nxlight + mcp->m_nplanes) {
388 pr("%s doesn't have room for any more planes\n", prship(sp));
391 sprintf(prompt, "Plane(s) to %s %s? ",
392 loading ? "load onto" : "unload from", prship(sp));
393 p = getstarg(player->argp[3], prompt, buf);
396 if (!snxtitem(&ni, EF_PLANE, p, NULL))
399 if (!still_ok_ship(sectp, sp))
403 noisy = ni.sel == NS_LIST;
405 while (nxtitem(&ni, &pln)) {
408 if (!(plchr[(int)pln.pln_type].pl_flags & P_L)
409 && !(plchr[(int)pln.pln_type].pl_flags & P_E)
410 && !(plchr[(int)pln.pln_type].pl_flags & P_K)
411 && !(plchr[(int)pln.pln_type].pl_flags & P_M)
414 pr("You can only load light planes, helos, xtra-light, or missiles onto ships.\n");
417 if (loading && pln.pln_ship > -1) {
419 pr("%s is already on ship #%d!\n",
420 prplane(&pln), pln.pln_ship);
423 if (loading && pln.pln_land > -1) {
425 pr("%s is already on land unit #%d!\n",
426 prplane(&pln), pln.pln_land);
429 if (pln.pln_harden != 0) {
431 pr("%s has been hardened and can't be loaded\n",
437 if (pln.pln_ship != sp->shp_uid)
439 } else if (sp->shp_x != pln.pln_x || sp->shp_y != pln.pln_y)
442 if (!could_be_on_ship(&pln, sp)) {
444 if (plchr[(int)pln.pln_type].pl_flags & P_K)
446 else if (plchr[(int)pln.pln_type].pl_flags & P_E)
447 p = "extra light planes";
448 else if (plchr[(int)pln.pln_type].pl_flags & P_M)
452 pr("%s cannot carry %s.\n", prship(sp), p);
456 /* Fit plane on ship */
458 if (!put_plane_on_ship(&pln, sp)) {
460 pr("Can't put plane %d on this ship!\n", pln.pln_uid);
463 sprintf(buf, "loaded on your %s at %s",
464 prship(sp), xyas(sp->shp_x, sp->shp_y, sp->shp_own));
465 gift(sp->shp_own, player->cnum, &pln, buf);
466 putplane(pln.pln_uid, &pln);
469 sprintf(buf, "unloaded in your %s at %s",
470 dchr[sectp->sct_type].d_name,
471 xyas(sectp->sct_x, sectp->sct_y, sectp->sct_own));
472 gift(sectp->sct_own, player->cnum, &pln, buf);
473 putplane(pln.pln_uid, &pln);
475 pr("%s %s %s at %s.\n",
477 loading ? "loaded onto" : "unloaded from",
478 prship(sp), xyas(sp->shp_x, sp->shp_y, player->cnum));
486 load_land_ship(struct sctstr *sectp, struct shpstr *sp, int noisy,
487 int loading, int *nshipsp)
497 if (!mchr[(int)sp->shp_type].m_nland
498 && !(mchr[sp->shp_type].m_flags & M_SUB)) {
500 pr("%s cannot carry land units!\n", prship(sp));
504 if ((mchr[(int)sp->shp_type].m_flags & M_SUB) &&
505 (mchr[(int)sp->shp_type].m_nland == 0)) {
506 if (shp_nland(sp) >= 2) {
507 pr("Non-land unit carrying subs can only carry up to two spy units.\n");
510 /* Eh, let 'em load a spy only */
513 if (!load_spy && shp_nland(sp) >= mchr[sp->shp_type].m_nland) {
515 pr("%s doesn't have room for any more land units!\n",
521 sprintf(prompt, "Land unit(s) to %s %s? ",
522 loading ? "load onto" : "unload from", prship(sp));
523 p = getstarg(player->argp[3], prompt, buf);
526 if (!snxtitem(&ni, EF_LAND, p, NULL))
529 if (!still_ok_ship(sectp, sp))
533 noisy = ni.sel == NS_LIST;
535 while (nxtitem(&ni, &land)) {
540 if (land.lnd_ship > -1) {
542 pr("%s is already on ship #%d!\n",
543 prland(&land), land.lnd_ship);
546 if (land.lnd_land > -1) {
548 pr("%s is already on land #%d!\n",
549 prland(&land), land.lnd_land);
552 if (lnd_first_on_land(&land) >= 0) {
554 pr("%s cannot be loaded since it is carrying units\n",
558 if (lchr[(int)land.lnd_type].l_flags & L_HEAVY) {
560 pr("%s is too heavy to load.\n", prland(&land));
563 if (load_spy && !(lchr[(int)land.lnd_type].l_flags & L_SPY)) {
565 pr("Subs can only carry spy units.\n");
570 /* Unit sanity done */
571 /* Find the right ship */
573 if (land.lnd_ship != sp->shp_uid)
575 if (land.lnd_land > -1)
577 } else if (sp->shp_x != land.lnd_x || sp->shp_y != land.lnd_y)
580 if ((!(lchr[(int)land.lnd_type].l_flags & L_LIGHT)) &&
581 (!((mchr[(int)sp->shp_type].m_flags & M_SUPPLY) &&
582 (!(mchr[(int)sp->shp_type].m_flags & M_SUB))))) {
584 pr("You can only load light units onto ships,\n");
585 pr("unless the ship is a non-sub supply ship\n");
586 pr("%s not loaded\n", prland(&land));
590 /* Fit unit on ship */
592 /* We have to check again, since it may have changed */
593 if ((mchr[(int)sp->shp_type].m_flags & M_SUB) &&
594 (mchr[(int)sp->shp_type].m_nland == 0)) {
595 if (shp_nland(sp) >= 2) {
596 pr("Non-land unit carrying subs can only carry up to two spy units.\n");
599 /* Eh, let 'em load a spy only */
602 if (!load_spy && shp_nland(sp) >= mchr[sp->shp_type].m_nland) {
604 if (mchr[(int)sp->shp_type].m_nland)
605 pr("%s doesn't have room for any more land units!\n",
608 pr("%s cannot carry land units!\n", prship(sp));
612 sprintf(buf, "loaded on your %s at %s",
613 prship(sp), xyas(sp->shp_x, sp->shp_y, sp->shp_own));
614 gift(sp->shp_own, player->cnum, &land, buf);
615 land.lnd_ship = sp->shp_uid;
617 putland(land.lnd_uid, &land);
620 * FIXME if this supplies from the sector, the putsect in
621 * load() / lload() duplicates those supplies, causing a
624 if (!lnd_supply_all(&land))
625 pr("WARNING: %s is out of supply!\n", prland(&land));
627 if (!lnd_in_supply(&land))
628 pr("WARNING: %s is out of supply!\n", prland(&land));
631 sprintf(buf, "unloaded in your %s at %s",
632 dchr[sectp->sct_type].d_name,
633 xyas(sectp->sct_x, sectp->sct_y, sectp->sct_own));
635 /* Spies are unloaded quietly, others aren't */
636 if (!(lchr[(int)land.lnd_type].l_flags & L_SPY))
637 gift(sectp->sct_own, player->cnum, &land, buf);
639 putland(land.lnd_uid, &land);
641 pr("%s %s %s at %s.\n",
643 loading ? "loaded onto" : "unloaded from",
644 prship(sp), xyas(sp->shp_x, sp->shp_y, player->cnum));
652 load_comm_ship(struct sctstr *sectp, struct shpstr *sp,
653 struct ichrstr *ich, int loading, int *nshipsp)
655 i_type item = ich->i_uid;
656 struct mchrstr *mcp = &mchr[(int)sp->shp_type];
657 int ship_amt, sect_amt, move_amt;
662 sprintf(prompt, "Number of %s to %s %s at %s? ",
664 loading ? "load onto" : "unload from",
665 prship(sp), xyas(sp->shp_x, sp->shp_y, player->cnum));
666 p = getstarg(player->argp[3], prompt, buf);
670 if (!still_ok_ship(sectp, sp))
673 ship_amt = sp->shp_item[item];
674 sect_amt = sectp->sct_item[item];
675 move_amt = move_amount(sect_amt, ship_amt, mcp->m_item[item],
677 if (!load_comm_ok(sectp, sp->shp_own, item, move_amt))
679 if (!abandon_askyn(sectp, item, move_amt, NULL))
681 if (!still_ok_ship(sectp, sp))
683 sectp->sct_item[item] = sect_amt - move_amt;
684 sp->shp_item[item] = ship_amt + move_amt;
687 pr("%d %s loaded onto %s at %s\n",
688 move_amt, ich->i_name,
689 prship(sp), xyas(sp->shp_x, sp->shp_y, player->cnum));
690 if (sp->shp_own != player->cnum) {
691 wu(0, sp->shp_own, "%s loaded %d %s onto %s at %s\n",
692 cname(player->cnum), move_amt, ich->i_name,
693 prship(sp), xyas(sp->shp_x, sp->shp_y, sp->shp_own));
696 pr("%d %s unloaded from %s at %s\n",
697 -move_amt, ich->i_name,
698 prship(sp), xyas(sp->shp_x, sp->shp_y, player->cnum));
699 if (sectp->sct_own != player->cnum) {
700 wu(0, sectp->sct_own, "%s unloaded %d %s from %s at %s\n",
701 cname(player->cnum), -move_amt, ich->i_name,
702 prship(sp), xyas(sp->shp_x, sp->shp_y, sectp->sct_own));
710 load_plane_land(struct sctstr *sectp, struct lndstr *lp, int noisy,
711 int loading, int *nunitsp)
719 struct lchrstr *lcp = lchr + lp->lnd_type;
721 if (!lcp->l_nxlight) {
723 pr("%s cannot carry extra-light planes.\n", prland(lp));
726 if (loading && lnd_nxlight(lp) >= lcp->l_nxlight) {
728 pr("%s doesn't have room for any more extra-light planes\n",
732 sprintf(prompt, "Plane(s) to %s %s? ",
733 loading ? "load onto" : "unload from", prland(lp));
734 p = getstarg(player->argp[3], prompt, buf);
737 if (!snxtitem(&ni, EF_PLANE, p, NULL))
740 if (!still_ok_land(sectp, lp))
744 noisy = ni.sel == NS_LIST;
746 while (nxtitem(&ni, &pln)) {
750 if (!(plchr[(int)pln.pln_type].pl_flags & P_E)) {
752 pr("You can only load xlight planes onto units.\n");
756 if (loading && pln.pln_ship > -1) {
758 pr("%s is already on ship #%d!\n",
759 prplane(&pln), pln.pln_ship);
762 if (loading && pln.pln_land > -1) {
764 pr("%s is already on unit #%d!\n",
765 prplane(&pln), pln.pln_land);
768 if (pln.pln_harden != 0) {
770 pr("%s has been hardened and can't be loaded\n",
775 /* Plane sanity done */
776 /* Find the right unit */
778 if (pln.pln_land != lp->lnd_uid)
780 } else if (lp->lnd_x != pln.pln_x || lp->lnd_y != pln.pln_y)
783 /* Fit plane on unit */
785 if (!put_plane_on_land(&pln, lp)) {
787 pr("Can't put plane %d on this unit!\n", pln.pln_uid);
790 sprintf(buf, "loaded on %s at %s",
791 prland(lp), xyas(lp->lnd_x, lp->lnd_y, lp->lnd_own));
792 gift(lp->lnd_own, player->cnum, &pln, buf);
793 putplane(pln.pln_uid, &pln);
796 sprintf(buf, "unloaded at your sector at %s",
797 xyas(sectp->sct_x, sectp->sct_y, sectp->sct_own));
798 gift(sectp->sct_own, player->cnum, &pln, buf);
799 putplane(pln.pln_uid, &pln);
801 pr("%s %s %s at %s.\n",
803 loading ? "loaded onto" : "unloaded from",
804 prland(lp), xyas(lp->lnd_x, lp->lnd_y, player->cnum));
812 load_comm_land(struct sctstr *sectp, struct lndstr *lp,
813 struct ichrstr *ich, int loading, int *nunitsp)
815 i_type item = ich->i_uid;
816 struct lchrstr *lcp = &lchr[(int)lp->lnd_type];
817 int land_amt, sect_amt, move_amt;
822 sprintf(prompt, "Number of %s to %s %s at %s? ",
824 loading ? "load onto" : "unload from",
825 prland(lp), xyas(lp->lnd_x, lp->lnd_y, player->cnum));
826 p = getstarg(player->argp[3], prompt, buf);
830 if (!still_ok_land(sectp, lp))
833 land_amt = lp->lnd_item[item];
834 sect_amt = sectp->sct_item[item];
835 move_amt = move_amount(sect_amt, land_amt, lcp->l_item[item],
837 if (!load_comm_ok(sectp, lp->lnd_own, item, move_amt))
839 sectp->sct_item[item] = sect_amt - move_amt;
840 lp->lnd_item[item] = land_amt + move_amt;
842 /* Did we put mils onto this unit? If so, reset the fortification */
843 if (item == I_MILIT && move_amt > 0)
847 pr("%d %s loaded onto %s at %s\n",
848 move_amt, ich->i_name,
849 prland(lp), xyas(lp->lnd_x, lp->lnd_y, player->cnum));
850 if (lp->lnd_own != player->cnum) {
851 wu(0, lp->lnd_own, "%s loaded %d %s onto %s at %s\n",
852 cname(player->cnum), move_amt, ich->i_name,
853 prland(lp), xyas(lp->lnd_x, lp->lnd_y, lp->lnd_own));
856 pr("%d %s unloaded from %s at %s\n",
857 -move_amt, ich->i_name,
858 prland(lp), xyas(lp->lnd_x, lp->lnd_y, player->cnum));
859 if (sectp->sct_own != player->cnum) {
860 wu(0, sectp->sct_own, "%s unloaded %d %s from %s at %s\n",
861 cname(player->cnum), -move_amt, ich->i_name,
862 prland(lp), xyas(lp->lnd_x, lp->lnd_y, sectp->sct_own));
870 load_land_land(struct sctstr *sectp, struct lndstr *lp, int noisy,
871 int loading, int *nunitsp)
880 if (!lchr[lp->lnd_type].l_nland) {
882 pr("%s cannot carry land units!\n", prland(lp));
885 if (loading && lnd_nland(lp) >= lchr[lp->lnd_type].l_nland) {
887 pr("%s doesn't have room for any more land units!\n",
891 sprintf(prompt, "Land unit(s) to %s %s? ",
892 loading ? "load onto" : "unload from", prland(lp));
893 p = getstarg(player->argp[3], prompt, buf);
896 if (!snxtitem(&ni, EF_LAND, p, NULL))
899 if (!still_ok_land(sectp, lp))
903 noisy = ni.sel == NS_LIST;
905 while (nxtitem(&ni, &land)) {
910 if (land.lnd_ship > -1) {
912 pr("%s is already on ship #%d!\n",
913 prland(&land), land.lnd_ship);
916 if (land.lnd_land > -1) {
918 pr("%s is already on land #%d!\n",
919 prland(&land), land.lnd_land);
922 if (lnd_first_on_land(&land) >= 0) {
924 pr("%s cannot be loaded since it is carrying units\n",
928 if (land.lnd_uid == lp->lnd_uid) {
930 pr("%s can't be loaded onto itself!\n", prland(&land));
933 if (lchr[(int)land.lnd_type].l_flags & (L_HEAVY | L_TRAIN)) {
935 pr("%s is too heavy to load.\n", prland(&land));
940 /* Unit sanity done */
941 /* Find the right ship */
943 if (land.lnd_land != lp->lnd_uid)
945 if (land.lnd_ship > -1)
947 } else if (lp->lnd_x != land.lnd_x || lp->lnd_y != land.lnd_y)
950 /* Fit unit on ship */
952 if (lnd_nland(lp) >= lchr[lp->lnd_type].l_nland) {
954 if (lchr[lp->lnd_type].l_nland)
955 pr("%s doesn't have room for any more land units!\n",
958 pr("%s cannot carry land units!\n", prland(lp));
962 sprintf(buf, "loaded on your %s at %s",
963 prland(lp), xyas(lp->lnd_x, lp->lnd_y, lp->lnd_own));
964 gift(lp->lnd_own, player->cnum, &land, buf);
965 land.lnd_land = lp->lnd_uid;
967 putland(land.lnd_uid, &land);
969 /* FIXME same issue as in load_land_ship() */
970 if (!lnd_supply_all(&land))
971 pr("WARNING: %s is out of supply!\n", prland(&land));
973 if (!lnd_in_supply(&land))
974 pr("WARNING: %s is out of supply!\n", prland(&land));
977 sprintf(buf, "unloaded in your %s at %s",
978 dchr[sectp->sct_type].d_name,
979 xyas(sectp->sct_x, sectp->sct_y, sectp->sct_own));
980 gift(sectp->sct_own, player->cnum, &land, buf);
982 putland(land.lnd_uid, &land);
984 pr("%s %s %s at %s.\n",
986 loading ? "loaded onto" : "unloaded from",
987 prland(lp), xyas(lp->lnd_x, lp->lnd_y, player->cnum));