Don't let fly and drop give away civilians
Flying them to a foreign destination magically changes their allegiance. Prohibit that. Equivalent change was already in commit35887222
(v4.2.17) but got reverted immediately (commit20199b22
), because fly and drop should stay consistent with load, which let you give away civilians then. No more since commit92a366ce
(v4.3.20). This change makes fly and drop consistent with load again.
This commit is contained in:
parent
b4acb73fd1
commit
729cf65e12
2 changed files with 20 additions and 9 deletions
|
@ -28,7 +28,7 @@
|
||||||
*
|
*
|
||||||
* Known contributors to this file:
|
* Known contributors to this file:
|
||||||
* Dave Pare, 1986
|
* Dave Pare, 1986
|
||||||
* Markus Armbruster, 2004-2011
|
* Markus Armbruster, 2004-2012
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
@ -74,9 +74,15 @@ drop(void)
|
||||||
|
|
||||||
if (relations_with(target.sct_own, player->cnum) == ALLIED) {
|
if (relations_with(target.sct_own, player->cnum) == ALLIED) {
|
||||||
/* own or allied sector: cargo drop */
|
/* own or allied sector: cargo drop */
|
||||||
if (ip->i_uid == I_CIVIL && target.sct_own != target.sct_oldown) {
|
if (ip->i_uid == I_CIVIL) {
|
||||||
pr("Can't drop civilians into occupied sectors.\n");
|
if (target.sct_own != player->cnum) {
|
||||||
return RET_FAIL;
|
pr("Your civilians refuse to board a flight abroad!\n");
|
||||||
|
return RET_FAIL;
|
||||||
|
}
|
||||||
|
if (target.sct_own != target.sct_oldown) {
|
||||||
|
pr("Can't drop civilians into occupied sectors.\n");
|
||||||
|
return RET_FAIL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
wantflags = P_C;
|
wantflags = P_C;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -80,11 +80,16 @@ fly(void)
|
||||||
return RET_SYN;
|
return RET_SYN;
|
||||||
cno = target.gen.ef_type == EF_SHIP ? target.gen.uid : -1;
|
cno = target.gen.ef_type == EF_SHIP ? target.gen.uid : -1;
|
||||||
|
|
||||||
if (ip && ip->i_uid == I_CIVIL
|
if (ip && ip->i_uid == I_CIVIL) {
|
||||||
&& target.gen.ef_type == EF_SECTOR
|
if (target.gen.own != player->cnum) {
|
||||||
&& target.sect.sct_own != target.sect.sct_oldown) {
|
pr("Your civilians refuse to board a flight abroad!\n");
|
||||||
pr("Can't fly civilians into occupied sectors.\n");
|
return RET_FAIL;
|
||||||
return RET_FAIL;
|
}
|
||||||
|
if (target.gen.ef_type == EF_SECTOR
|
||||||
|
&& target.sect.sct_own != target.sect.sct_oldown) {
|
||||||
|
pr("Can't fly civilians into occupied sectors.\n");
|
||||||
|
return RET_FAIL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ap_to_target = strlen(flightpath);
|
ap_to_target = strlen(flightpath);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue