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-2018
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 pr("%s doesn't have room for any more land units!\n",
608 sprintf(buf, "loaded on your %s at %s",
609 prship(sp), xyas(sp->shp_x, sp->shp_y, sp->shp_own));
610 gift(sp->shp_own, player->cnum, &land, buf);
611 land.lnd_ship = sp->shp_uid;
613 putland(land.lnd_uid, &land);
616 * FIXME if this supplies from the sector, the putsect in
617 * load() / lload() duplicates those supplies, causing a
620 if (!lnd_supply_all(&land))
621 pr("WARNING: %s is out of supply!\n", prland(&land));
623 if (!lnd_in_supply(&land))
624 pr("WARNING: %s is out of supply!\n", prland(&land));
627 sprintf(buf, "unloaded in your %s at %s",
628 dchr[sectp->sct_type].d_name,
629 xyas(sectp->sct_x, sectp->sct_y, sectp->sct_own));
631 /* Spies are unloaded quietly, others aren't */
632 if (!(lchr[(int)land.lnd_type].l_flags & L_SPY))
633 gift(sectp->sct_own, player->cnum, &land, buf);
635 putland(land.lnd_uid, &land);
637 pr("%s %s %s at %s.\n",
639 loading ? "loaded onto" : "unloaded from",
640 prship(sp), xyas(sp->shp_x, sp->shp_y, player->cnum));
648 load_comm_ship(struct sctstr *sectp, struct shpstr *sp,
649 struct ichrstr *ich, int loading, int *nshipsp)
651 i_type item = ich->i_uid;
652 struct mchrstr *mcp = &mchr[(int)sp->shp_type];
653 int ship_amt, sect_amt, move_amt;
658 sprintf(prompt, "Number of %s to %s %s at %s? ",
660 loading ? "load onto" : "unload from",
661 prship(sp), xyas(sp->shp_x, sp->shp_y, player->cnum));
662 p = getstarg(player->argp[3], prompt, buf);
666 if (!still_ok_ship(sectp, sp))
669 ship_amt = sp->shp_item[item];
670 sect_amt = sectp->sct_item[item];
671 move_amt = move_amount(sect_amt, ship_amt, mcp->m_item[item],
673 if (!load_comm_ok(sectp, sp->shp_own, item, move_amt))
675 if (!abandon_askyn(sectp, item, move_amt, NULL))
677 if (!still_ok_ship(sectp, sp))
679 sectp->sct_item[item] = sect_amt - move_amt;
680 sp->shp_item[item] = ship_amt + move_amt;
683 pr("%d %s loaded onto %s at %s\n",
684 move_amt, ich->i_name,
685 prship(sp), xyas(sp->shp_x, sp->shp_y, player->cnum));
686 if (sp->shp_own != player->cnum) {
687 wu(0, sp->shp_own, "%s loaded %d %s onto %s at %s\n",
688 cname(player->cnum), move_amt, ich->i_name,
689 prship(sp), xyas(sp->shp_x, sp->shp_y, sp->shp_own));
692 pr("%d %s unloaded from %s at %s\n",
693 -move_amt, ich->i_name,
694 prship(sp), xyas(sp->shp_x, sp->shp_y, player->cnum));
695 if (sectp->sct_own != player->cnum) {
696 wu(0, sectp->sct_own, "%s unloaded %d %s from %s at %s\n",
697 cname(player->cnum), -move_amt, ich->i_name,
698 prship(sp), xyas(sp->shp_x, sp->shp_y, sectp->sct_own));
706 load_plane_land(struct sctstr *sectp, struct lndstr *lp, int noisy,
707 int loading, int *nunitsp)
715 struct lchrstr *lcp = lchr + lp->lnd_type;
717 if (!lcp->l_nxlight) {
719 pr("%s cannot carry extra-light planes.\n", prland(lp));
722 if (loading && lnd_nxlight(lp) >= lcp->l_nxlight) {
724 pr("%s doesn't have room for any more extra-light planes\n",
728 sprintf(prompt, "Plane(s) to %s %s? ",
729 loading ? "load onto" : "unload from", prland(lp));
730 p = getstarg(player->argp[3], prompt, buf);
733 if (!snxtitem(&ni, EF_PLANE, p, NULL))
736 if (!still_ok_land(sectp, lp))
740 noisy = ni.sel == NS_LIST;
742 while (nxtitem(&ni, &pln)) {
746 if (!(plchr[(int)pln.pln_type].pl_flags & P_E)) {
748 pr("You can only load xlight planes onto units.\n");
752 if (loading && pln.pln_ship > -1) {
754 pr("%s is already on ship #%d!\n",
755 prplane(&pln), pln.pln_ship);
758 if (loading && pln.pln_land > -1) {
760 pr("%s is already on unit #%d!\n",
761 prplane(&pln), pln.pln_land);
764 if (pln.pln_harden != 0) {
766 pr("%s has been hardened and can't be loaded\n",
771 /* Plane sanity done */
772 /* Find the right unit */
774 if (pln.pln_land != lp->lnd_uid)
776 } else if (lp->lnd_x != pln.pln_x || lp->lnd_y != pln.pln_y)
779 /* Fit plane on unit */
781 if (!put_plane_on_land(&pln, lp)) {
783 pr("Can't put plane %d on this unit!\n", pln.pln_uid);
786 sprintf(buf, "loaded on %s at %s",
787 prland(lp), xyas(lp->lnd_x, lp->lnd_y, lp->lnd_own));
788 gift(lp->lnd_own, player->cnum, &pln, buf);
789 putplane(pln.pln_uid, &pln);
792 sprintf(buf, "unloaded at your sector at %s",
793 xyas(sectp->sct_x, sectp->sct_y, sectp->sct_own));
794 gift(sectp->sct_own, player->cnum, &pln, buf);
795 putplane(pln.pln_uid, &pln);
797 pr("%s %s %s at %s.\n",
799 loading ? "loaded onto" : "unloaded from",
800 prland(lp), xyas(lp->lnd_x, lp->lnd_y, player->cnum));
808 load_comm_land(struct sctstr *sectp, struct lndstr *lp,
809 struct ichrstr *ich, int loading, int *nunitsp)
811 i_type item = ich->i_uid;
812 struct lchrstr *lcp = &lchr[(int)lp->lnd_type];
813 int land_amt, sect_amt, move_amt;
818 sprintf(prompt, "Number of %s to %s %s at %s? ",
820 loading ? "load onto" : "unload from",
821 prland(lp), xyas(lp->lnd_x, lp->lnd_y, player->cnum));
822 p = getstarg(player->argp[3], prompt, buf);
826 if (!still_ok_land(sectp, lp))
829 land_amt = lp->lnd_item[item];
830 sect_amt = sectp->sct_item[item];
831 move_amt = move_amount(sect_amt, land_amt, lcp->l_item[item],
833 if (!load_comm_ok(sectp, lp->lnd_own, item, move_amt))
835 sectp->sct_item[item] = sect_amt - move_amt;
836 lp->lnd_item[item] = land_amt + move_amt;
838 /* Did we put mils onto this unit? If so, reset the fortification */
839 if (item == I_MILIT && move_amt > 0)
843 pr("%d %s loaded onto %s at %s\n",
844 move_amt, ich->i_name,
845 prland(lp), xyas(lp->lnd_x, lp->lnd_y, player->cnum));
846 if (lp->lnd_own != player->cnum) {
847 wu(0, lp->lnd_own, "%s loaded %d %s onto %s at %s\n",
848 cname(player->cnum), move_amt, ich->i_name,
849 prland(lp), xyas(lp->lnd_x, lp->lnd_y, lp->lnd_own));
852 pr("%d %s unloaded from %s at %s\n",
853 -move_amt, ich->i_name,
854 prland(lp), xyas(lp->lnd_x, lp->lnd_y, player->cnum));
855 if (sectp->sct_own != player->cnum) {
856 wu(0, sectp->sct_own, "%s unloaded %d %s from %s at %s\n",
857 cname(player->cnum), -move_amt, ich->i_name,
858 prland(lp), xyas(lp->lnd_x, lp->lnd_y, sectp->sct_own));
866 load_land_land(struct sctstr *sectp, struct lndstr *lp, int noisy,
867 int loading, int *nunitsp)
876 if (!lchr[lp->lnd_type].l_nland) {
878 pr("%s cannot carry land units!\n", prland(lp));
881 if (loading && lnd_nland(lp) >= lchr[lp->lnd_type].l_nland) {
883 pr("%s doesn't have room for any more land units!\n",
887 sprintf(prompt, "Land unit(s) to %s %s? ",
888 loading ? "load onto" : "unload from", prland(lp));
889 p = getstarg(player->argp[3], prompt, buf);
892 if (!snxtitem(&ni, EF_LAND, p, NULL))
895 if (!still_ok_land(sectp, lp))
899 noisy = ni.sel == NS_LIST;
901 while (nxtitem(&ni, &land)) {
906 if (land.lnd_ship > -1) {
908 pr("%s is already on ship #%d!\n",
909 prland(&land), land.lnd_ship);
912 if (land.lnd_land > -1) {
914 pr("%s is already on land #%d!\n",
915 prland(&land), land.lnd_land);
918 if (lnd_first_on_land(&land) >= 0) {
920 pr("%s cannot be loaded since it is carrying units\n",
924 if (land.lnd_uid == lp->lnd_uid) {
926 pr("%s can't be loaded onto itself!\n", prland(&land));
929 if (lchr[(int)land.lnd_type].l_flags & (L_HEAVY | L_TRAIN)) {
931 pr("%s is too heavy to load.\n", prland(&land));
936 /* Unit sanity done */
937 /* Find the right ship */
939 if (land.lnd_land != lp->lnd_uid)
941 if (land.lnd_ship > -1)
943 } else if (lp->lnd_x != land.lnd_x || lp->lnd_y != land.lnd_y)
946 /* Fit unit on ship */
948 if (lnd_nland(lp) >= lchr[lp->lnd_type].l_nland) {
950 pr("%s doesn't have room for any more land units!\n",
954 sprintf(buf, "loaded on your %s at %s",
955 prland(lp), xyas(lp->lnd_x, lp->lnd_y, lp->lnd_own));
956 gift(lp->lnd_own, player->cnum, &land, buf);
957 land.lnd_land = lp->lnd_uid;
959 putland(land.lnd_uid, &land);
961 /* FIXME same issue as in load_land_ship() */
962 if (!lnd_supply_all(&land))
963 pr("WARNING: %s is out of supply!\n", prland(&land));
965 if (!lnd_in_supply(&land))
966 pr("WARNING: %s is out of supply!\n", prland(&land));
969 sprintf(buf, "unloaded in your %s at %s",
970 dchr[sectp->sct_type].d_name,
971 xyas(sectp->sct_x, sectp->sct_y, sectp->sct_own));
972 gift(sectp->sct_own, player->cnum, &land, buf);
974 putland(land.lnd_uid, &land);
976 pr("%s %s %s at %s.\n",
978 loading ? "loaded onto" : "unloaded from",
979 prland(lp), xyas(lp->lnd_x, lp->lnd_y, player->cnum));