fly() reads the carrier, then passes it to pln_dropoff(), which writes
it back. fly() also calls pln_oneway_to_carrier_ok(), which updates
the carrier when its plane summary information is incorrect.
The old code called it between reading the carrier and passing it to
pln_dropoff(). This made pln_dropoff() wipe out the plane summary
update, and triggered a seqno mismatch oops. Broken by introduction
of pln_oneway_to_carrier_ok() in commit
1127762c, v4.2.17.
Fix by reading the carrier right before passing it to pln_dropoff().
(cherry picked from commit
42d9475d894f6779dab17655cd5082b66b9acac9)
cno = -1;
if (pln_onewaymission(&target, &cno, &wantflags) < 0)
return RET_SYN;
- if (cno < 0) {
- dst_ptr = ⌖
- dst_type = EF_SECTOR;
- } else {
- getship(cno, &ship);
- dst_ptr = &ship;
- dst_type = EF_SHIP;
- }
if (ip && ip->i_uid == I_CIVIL && target.sct_own != target.sct_oldown) {
pr("Can't fly civilians into occupied sectors.\n");
pr("No planes got through fighter defenses\n");
} else {
getsect(tx, ty, &target);
+ if (cno < 0) {
+ dst_ptr = ⌖
+ dst_type = EF_SECTOR;
+ } else {
+ getship(cno, &ship);
+ dst_ptr = &ship;
+ dst_type = EF_SHIP;
+ }
pln_dropoff(&bomb_list, ip, tx, ty, dst_ptr, dst_type);
pln_newlanding(&bomb_list, tx, ty, cno);
pln_newlanding(&esc_list, tx, ty, cno);