]> git.pond.sub.org Git - empserver/blobdiff - src/lib/subs/plnsub.c
Fix pln_equip()'s check for foreign civilians
[empserver] / src / lib / subs / plnsub.c
index 9bae8323b376722197797fb25dd094877118cd17..661529abbbc2c790abd5c8016a2d40dac1f3b0da 100644 (file)
@@ -637,14 +637,6 @@ pln_equip(struct plist *plp, struct ichrstr *ip, int flags, char mission)
        item = sect.sct_item;
        own = sect.sct_oldown;
     }
-    if (ip) {
-       if (ip->i_uid == I_CIVIL) {
-           if (pp->pln_own != own) {
-               pr("You don't control those civilians!\n");
-               return -1;
-           }
-       }
-    }
     if (pcp->pl_fuel > item[I_PETROL]) {
        pr("%s not enough petrol there!\n", prplane(pp));
        return -1;
@@ -690,6 +682,10 @@ pln_equip(struct plist *plp, struct ichrstr *ip, int flags, char mission)
            pr("%s can't contribute to mission\n", prplane(pp));
            return -1;
        }
+       if (itype == I_CIVIL && pp->pln_own != own) {
+           pr("You don't control those civilians!\n");
+           return -1;
+       }
        if (itype != I_NONE) {
 #if 0
            /* Supply is broken somewhere, so don't use it for now */