From 1621522c1c408c0182a88c9aadca678dde672809 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sat, 17 Aug 2013 17:57:23 +0200 Subject: [PATCH] supply: Fix harmless bug in supply from ship in same sector Bug bites when a ship supplies the sector it's in. First the sector is charged zero mob for moving the stuff, and is written back. Next, the sector receives the stuff, and is written back, clobbering the first write (no effect), and triggering a seqno oops. Signed-off-by: Markus Armbruster --- src/lib/subs/supply.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lib/subs/supply.c b/src/lib/subs/supply.c index b820934f7..2cff0ed6c 100644 --- a/src/lib/subs/supply.c +++ b/src/lib/subs/supply.c @@ -267,7 +267,8 @@ s_commod(struct empobj *sink, short *vec, if (actually_doit) { vec[type] += can_move; putship(ship.shp_uid, &ship); - putsect(§); + if (n) + putsect(§); put_empobj(sink->ef_type, sink->uid, sink); } return 1; @@ -281,7 +282,8 @@ s_commod(struct empobj *sink, short *vec, if (actually_doit) { vec[type] += can_move; putship(ship.shp_uid, &ship); - putsect(§); + if (n) + putsect(§); } } } -- 2.43.0