/*
* Empire - A multi-player, client/server Internet based war game.
- * Copyright (C) 1986-2009, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ * Copyright (C) 1986-2010, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure
*
* This program is free software; you can redistribute it and/or modify
/*
* The values 1 and -1 are important below, don't change them.
*/
-#define LOAD 1
-#define UNLOAD -1
+#define LOAD 1
+#define UNLOAD -1
static int load_plane_ship(struct sctstr *sectp, struct shpstr *sp,
int noisy, int load_unload, int *nshipsp);
xyas(sect.sct_x, sect.sct_y, player->cnum));
continue;
}
- if (!player->owner && load_unload == UNLOAD
+ if (load_unload == UNLOAD
+ && !player->owner
&& getrel(getnatp(sect.sct_own), player->cnum) < FRIENDLY) {
if (noisy)
pr("You can't unload into an unfriendly %s\n",
static int
move_amount(int sect_amt, int unit_amt, int unit_max,
- int load_unload, int amount)
+ int load_unload, int amount)
{
int move_amt;
continue;
}
- /* Plane sanity done */
- /* Find the right ship */
if (load_unload == UNLOAD) {
if (pln.pln_ship != sp->shp_uid)
continue;
} else if (sp->shp_x != pln.pln_x || sp->shp_y != pln.pln_y)
continue;
- /* ship to (plane or missle) sanity */
if (!could_be_on_ship(&pln, sp, 0, 0, 0, 0)) {
- if (plchr[(int)pln.pln_type].pl_flags & P_L) {
- strcpy(buf, "planes");
- } else if (plchr[(int)pln.pln_type].pl_flags & P_K) {
- strcpy(buf, "choppers");
- } else if (plchr[(int)pln.pln_type].pl_flags & P_M) {
- strcpy(buf, "missiles");
- } else if (plchr[(int)pln.pln_type].pl_flags & P_E) {
- strcpy(buf, "extra light planes");
- } /* else impossible */
- if (noisy)
- pr("%s cannot carry %s.\n", prship(sp), buf);
+ if (noisy) {
+ if (plchr[(int)pln.pln_type].pl_flags & P_K)
+ p = "choppers";
+ else if (plchr[(int)pln.pln_type].pl_flags & P_E)
+ p = "extra light planes";
+ else if (plchr[(int)pln.pln_type].pl_flags & P_M)
+ p = "missiles";
+ else
+ p = "planes";
+ pr("%s cannot carry %s.\n", prship(sp), p);
+ }
continue;
}
/* Fit plane on ship */
land.lnd_harden = 0;
putland(land.lnd_uid, &land);
#if 0
- /*
- * FIXME if this supplies from the sector, the putsect in
- * load() / lload() duplicates those supplies, causing a
- * seqno mismatch
- */
+ /*
+ * FIXME if this supplies from the sector, the putsect in
+ * load() / lload() duplicates those supplies, causing a
+ * seqno mismatch
+ */
if (!lnd_supply_all(&land))
pr("WARNING: %s is out of supply!\n", prland(&land));
#else
land.lnd_harden = 0;
putland(land.lnd_uid, &land);
#if 0
- /* FIXME same issue as in load_land_ship() */
+ /* FIXME same issue as in load_land_ship() */
if (!lnd_supply_all(&land))
pr("WARNING: %s is out of supply!\n", prland(&land));
#else