From 6aefeea2a168338a6eb13e9d096c4373f141a6a9 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sat, 12 Jul 2008 10:56:30 -0400 Subject: [PATCH] Fix seqno mismatch in fly() 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) --- src/lib/commands/fly.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/lib/commands/fly.c b/src/lib/commands/fly.c index ed55fbca0..1fdfef90e 100644 --- a/src/lib/commands/fly.c +++ b/src/lib/commands/fly.c @@ -87,14 +87,6 @@ fly(void) 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"); @@ -142,6 +134,14 @@ fly(void) 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); -- 2.43.0