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);
100 if (!snxtitem(&nbst, EF_SHIP, p, NULL))
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);
229 if (!snxtitem(&nbst, EF_LAND, p, NULL))
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))
402 if (noisy && p && *p)
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)
498 if ((mchr[(int)sp->shp_type].m_flags & M_SUB) &&
499 (mchr[(int)sp->shp_type].m_nland == 0)) {
500 if (shp_nland(sp) >= 2) {
501 pr("Non-land unit carrying subs can only carry up to two spy units.\n");
504 /* Eh, let 'em load a spy only */
507 if (!load_spy && shp_nland(sp) >= mchr[sp->shp_type].m_nland) {
509 if (mchr[(int)sp->shp_type].m_nland)
510 pr("%s doesn't have room for any more land units!\n",
513 pr("%s cannot carry land units!\n", prship(sp));
518 sprintf(prompt, "Land unit(s) to %s %s? ",
519 loading ? "load onto" : "unload from", prship(sp));
520 p = getstarg(player->argp[3], prompt, buf);
523 if (!snxtitem(&ni, EF_LAND, p, NULL))
526 if (!still_ok_ship(sectp, sp))
529 if (noisy && p && *p)
532 while (nxtitem(&ni, &land)) {
537 if (land.lnd_ship > -1) {
539 pr("%s is already on ship #%d!\n",
540 prland(&land), land.lnd_ship);
543 if (land.lnd_land > -1) {
545 pr("%s is already on land #%d!\n",
546 prland(&land), land.lnd_land);
549 if (lnd_first_on_land(&land) >= 0) {
551 pr("%s cannot be loaded since it is carrying units\n",
555 if (lchr[(int)land.lnd_type].l_flags & L_HEAVY) {
557 pr("%s is too heavy to load.\n", prland(&land));
560 if (load_spy && !(lchr[(int)land.lnd_type].l_flags & L_SPY)) {
562 pr("Subs can only carry spy units.\n");
567 /* Unit sanity done */
568 /* Find the right ship */
570 if (land.lnd_ship != sp->shp_uid)
572 if (land.lnd_land > -1)
574 } else if (sp->shp_x != land.lnd_x || sp->shp_y != land.lnd_y)
577 if ((!(lchr[(int)land.lnd_type].l_flags & L_LIGHT)) &&
578 (!((mchr[(int)sp->shp_type].m_flags & M_SUPPLY) &&
579 (!(mchr[(int)sp->shp_type].m_flags & M_SUB))))) {
581 pr("You can only load light units onto ships,\n");
582 pr("unless the ship is a non-sub supply ship\n");
583 pr("%s not loaded\n", prland(&land));
587 /* Fit unit on ship */
589 /* We have to check again, since it may have changed */
590 if ((mchr[(int)sp->shp_type].m_flags & M_SUB) &&
591 (mchr[(int)sp->shp_type].m_nland == 0)) {
592 if (shp_nland(sp) >= 2) {
593 pr("Non-land unit carrying subs can only carry up to two spy units.\n");
596 /* Eh, let 'em load a spy only */
599 if (!load_spy && shp_nland(sp) >= mchr[sp->shp_type].m_nland) {
601 if (mchr[(int)sp->shp_type].m_nland)
602 pr("%s doesn't have room for any more land units!\n",
605 pr("%s cannot carry land units!\n", prship(sp));
609 sprintf(buf, "loaded on your %s at %s",
610 prship(sp), xyas(sp->shp_x, sp->shp_y, sp->shp_own));
611 gift(sp->shp_own, player->cnum, &land, buf);
612 land.lnd_ship = sp->shp_uid;
614 putland(land.lnd_uid, &land);
617 * FIXME if this supplies from the sector, the putsect in
618 * load() / lload() duplicates those supplies, causing a
621 if (!lnd_supply_all(&land))
622 pr("WARNING: %s is out of supply!\n", prland(&land));
624 if (!lnd_in_supply(&land))
625 pr("WARNING: %s is out of supply!\n", prland(&land));
628 sprintf(buf, "unloaded in your %s at %s",
629 dchr[sectp->sct_type].d_name,
630 xyas(sectp->sct_x, sectp->sct_y, sectp->sct_own));
632 /* Spies are unloaded quietly, others aren't */
633 if (!(lchr[(int)land.lnd_type].l_flags & L_SPY))
634 gift(sectp->sct_own, player->cnum, &land, buf);
636 putland(land.lnd_uid, &land);
638 pr("%s %s %s at %s.\n",
640 loading ? "loaded onto" : "unloaded from",
641 prship(sp), xyas(sp->shp_x, sp->shp_y, player->cnum));
649 load_comm_ship(struct sctstr *sectp, struct shpstr *sp,
650 struct ichrstr *ich, int loading, int *nshipsp)
652 i_type item = ich->i_uid;
653 struct mchrstr *mcp = &mchr[(int)sp->shp_type];
654 int ship_amt, sect_amt, move_amt;
659 sprintf(prompt, "Number of %s to %s %s at %s? ",
661 loading ? "load onto" : "unload from",
662 prship(sp), xyas(sp->shp_x, sp->shp_y, player->cnum));
663 p = getstarg(player->argp[3], prompt, buf);
667 if (!still_ok_ship(sectp, sp))
670 ship_amt = sp->shp_item[item];
671 sect_amt = sectp->sct_item[item];
672 move_amt = move_amount(sect_amt, ship_amt, mcp->m_item[item],
674 if (!load_comm_ok(sectp, sp->shp_own, item, move_amt))
676 if (!abandon_askyn(sectp, item, move_amt, NULL))
678 if (!still_ok_ship(sectp, sp))
680 sectp->sct_item[item] = sect_amt - move_amt;
681 sp->shp_item[item] = ship_amt + move_amt;
684 pr("%d %s loaded onto %s at %s\n",
685 move_amt, ich->i_name,
686 prship(sp), xyas(sp->shp_x, sp->shp_y, player->cnum));
687 if (sp->shp_own != player->cnum) {
688 wu(0, sp->shp_own, "%s loaded %d %s onto %s at %s\n",
689 cname(player->cnum), move_amt, ich->i_name,
690 prship(sp), xyas(sp->shp_x, sp->shp_y, sp->shp_own));
693 pr("%d %s unloaded from %s at %s\n",
694 -move_amt, ich->i_name,
695 prship(sp), xyas(sp->shp_x, sp->shp_y, player->cnum));
696 if (sectp->sct_own != player->cnum) {
697 wu(0, sectp->sct_own, "%s unloaded %d %s from %s at %s\n",
698 cname(player->cnum), -move_amt, ich->i_name,
699 prship(sp), xyas(sp->shp_x, sp->shp_y, sectp->sct_own));
707 load_plane_land(struct sctstr *sectp, struct lndstr *lp, int noisy,
708 int loading, int *nunitsp)
716 struct lchrstr *lcp = lchr + lp->lnd_type;
718 if (!lcp->l_nxlight) {
720 pr("%s cannot carry extra-light planes.\n", prland(lp));
723 if (loading && lnd_nxlight(lp) >= lcp->l_nxlight) {
725 pr("%s doesn't have room for any more extra-light planes\n",
729 sprintf(prompt, "Plane(s) to %s %s? ",
730 loading ? "load onto" : "unload from", prland(lp));
731 p = getstarg(player->argp[3], prompt, buf);
734 if (!snxtitem(&ni, EF_PLANE, p, NULL))
737 if (!still_ok_land(sectp, lp))
740 if (noisy && p && *p)
743 while (nxtitem(&ni, &pln)) {
747 if (!(plchr[(int)pln.pln_type].pl_flags & P_E)) {
749 pr("You can only load xlight planes onto units.\n");
753 if (loading && pln.pln_ship > -1) {
755 pr("%s is already on ship #%d!\n",
756 prplane(&pln), pln.pln_ship);
759 if (loading && pln.pln_land > -1) {
761 pr("%s is already on unit #%d!\n",
762 prplane(&pln), pln.pln_land);
765 if (pln.pln_harden != 0) {
767 pr("%s has been hardened and can't be loaded\n",
772 /* Plane sanity done */
773 /* Find the right unit */
775 if (pln.pln_land != lp->lnd_uid)
777 } else if (lp->lnd_x != pln.pln_x || lp->lnd_y != pln.pln_y)
780 /* Fit plane on unit */
782 if (!put_plane_on_land(&pln, lp)) {
784 pr("Can't put plane %d on this unit!\n", pln.pln_uid);
787 sprintf(buf, "loaded on %s at %s",
788 prland(lp), xyas(lp->lnd_x, lp->lnd_y, lp->lnd_own));
789 gift(lp->lnd_own, player->cnum, &pln, buf);
790 putplane(pln.pln_uid, &pln);
793 sprintf(buf, "unloaded at your sector at %s",
794 xyas(sectp->sct_x, sectp->sct_y, sectp->sct_own));
795 gift(sectp->sct_own, player->cnum, &pln, buf);
796 putplane(pln.pln_uid, &pln);
798 pr("%s %s %s at %s.\n",
800 loading ? "loaded onto" : "unloaded from",
801 prland(lp), xyas(lp->lnd_x, lp->lnd_y, player->cnum));
809 load_comm_land(struct sctstr *sectp, struct lndstr *lp,
810 struct ichrstr *ich, int loading, int *nunitsp)
812 i_type item = ich->i_uid;
813 struct lchrstr *lcp = &lchr[(int)lp->lnd_type];
814 int land_amt, sect_amt, move_amt;
819 sprintf(prompt, "Number of %s to %s %s at %s? ",
821 loading ? "load onto" : "unload from",
822 prland(lp), xyas(lp->lnd_x, lp->lnd_y, player->cnum));
823 p = getstarg(player->argp[3], prompt, buf);
827 if (!still_ok_land(sectp, lp))
830 land_amt = lp->lnd_item[item];
831 sect_amt = sectp->sct_item[item];
832 move_amt = move_amount(sect_amt, land_amt, lcp->l_item[item],
834 if (!load_comm_ok(sectp, lp->lnd_own, item, move_amt))
836 sectp->sct_item[item] = sect_amt - move_amt;
837 lp->lnd_item[item] = land_amt + move_amt;
839 /* Did we put mils onto this unit? If so, reset the fortification */
840 if (item == I_MILIT && move_amt > 0)
844 pr("%d %s loaded onto %s at %s\n",
845 move_amt, ich->i_name,
846 prland(lp), xyas(lp->lnd_x, lp->lnd_y, player->cnum));
847 if (lp->lnd_own != player->cnum) {
848 wu(0, lp->lnd_own, "%s loaded %d %s onto %s at %s\n",
849 cname(player->cnum), move_amt, ich->i_name,
850 prland(lp), xyas(lp->lnd_x, lp->lnd_y, lp->lnd_own));
853 pr("%d %s unloaded from %s at %s\n",
854 -move_amt, ich->i_name,
855 prland(lp), xyas(lp->lnd_x, lp->lnd_y, player->cnum));
856 if (sectp->sct_own != player->cnum) {
857 wu(0, sectp->sct_own, "%s unloaded %d %s from %s at %s\n",
858 cname(player->cnum), -move_amt, ich->i_name,
859 prland(lp), xyas(lp->lnd_x, lp->lnd_y, sectp->sct_own));
867 load_land_land(struct sctstr *sectp, struct lndstr *lp, int noisy,
868 int loading, int *nunitsp)
877 if (loading && lnd_nland(lp) >= lchr[lp->lnd_type].l_nland) {
879 if (lchr[lp->lnd_type].l_nland)
880 pr("%s doesn't have room for any more land units!\n",
883 pr("%s cannot carry land units!\n", prland(lp));
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))
898 if (noisy && p && *p)
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 if (lchr[lp->lnd_type].l_nland)
951 pr("%s doesn't have room for any more land units!\n",
954 pr("%s cannot carry land units!\n", prland(lp));
958 sprintf(buf, "loaded on your %s at %s",
959 prland(lp), xyas(lp->lnd_x, lp->lnd_y, lp->lnd_own));
960 gift(lp->lnd_own, player->cnum, &land, buf);
961 land.lnd_land = lp->lnd_uid;
963 putland(land.lnd_uid, &land);
965 /* FIXME same issue as in load_land_ship() */
966 if (!lnd_supply_all(&land))
967 pr("WARNING: %s is out of supply!\n", prland(&land));
969 if (!lnd_in_supply(&land))
970 pr("WARNING: %s is out of supply!\n", prland(&land));
973 sprintf(buf, "unloaded in your %s at %s",
974 dchr[sectp->sct_type].d_name,
975 xyas(sectp->sct_x, sectp->sct_y, sectp->sct_own));
976 gift(sectp->sct_own, player->cnum, &land, buf);
978 putland(land.lnd_uid, &land);
980 pr("%s %s %s at %s.\n",
982 loading ? "loaded onto" : "unloaded from",
983 prland(lp), xyas(lp->lnd_x, lp->lnd_y, player->cnum));