We fail to delete trades right away when the unit on sale dies.
Instead, we delete trades of the dead whenever we look at the market.
Doesn't work when new builds reuse the IDs of such dead. If the new
unit's owner differs from the dead one's, we still delete the trade,
and log "Something weird". If they are the same, the newly built unit
takes the dead one's place on the market. Has been that way since the
market was added in 4.0.0.
I can't fix this right now, so mark as FIXME, and drop the logerror().
The first of the two trade deletions is now redundant, so drop that,
too.
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
continue;
if (!trade_getitem(&trade, &tg))
continue;
- if (tg.gen.own == 0) {
- trade.trd_owner = 0;
- puttrade(n, &trade);
- continue;
- }
+ /*
+ * FIXME We fail to delete trades right away when the thing on
+ * sale dies. Instead, we delete it here. Doesn't work if it
+ * has been rebuilt by the same owner; in that case, the new
+ * one takes the dead one's place on the market.
+ */
if (tg.gen.own != trade.trd_owner) {
- logerror("Something weird, tg.gen.own != trade.trd_owner!\n");
trade.trd_owner = 0;
puttrade(n, &trade);
continue;