From 9e6b5a91335a5891f3239ea1e457a7b0df014cee Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sun, 13 Jun 2010 17:20:00 +0200 Subject: [PATCH] Don't let deities fly foreign planes Much code assumes that only the plane's owner can fly it. pln_airbase_ok() oopses since commit 446f1991. Before, flying planes from carriers failed with a bogus "not valid for" message, and flying from sectors had output misdirected to the plane's owner. It would be nice to let deities fly foreign planes, but the assumption is not trivial to remove, so just satisfy it for now. Historical note: it looks like deities used to be able to fly foreign planes just fine until Chainsaw 3 added missions. The launch command has always rejected foreign planes, even for deities. --- src/lib/subs/plnsub.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lib/subs/plnsub.c b/src/lib/subs/plnsub.c index 00f2b37c..42b66634 100644 --- a/src/lib/subs/plnsub.c +++ b/src/lib/subs/plnsub.c @@ -541,7 +541,12 @@ pln_sel(struct nstr_item *ni, struct emp_qelem *list, struct sctstr *ap, emp_initque(list); while (nxtitem(ni, &plane)) { - if (!player->owner) + /* + * It would be nice to let deities fly foreign planes, but + * much of the code assumes that only the plane's owner can + * fly it. + */ + if (plane.pln_own != player->cnum) continue; if (plane.pln_mobil <= 0) continue;