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.
This commit is contained in:
parent
2f4b5973ce
commit
9e6b5a9133
1 changed files with 6 additions and 1 deletions
|
@ -541,7 +541,12 @@ pln_sel(struct nstr_item *ni, struct emp_qelem *list, struct sctstr *ap,
|
||||||
|
|
||||||
emp_initque(list);
|
emp_initque(list);
|
||||||
while (nxtitem(ni, &plane)) {
|
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;
|
continue;
|
||||||
if (plane.pln_mobil <= 0)
|
if (plane.pln_mobil <= 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue