market: Simplify check for dead trades and document how it fails
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>
This commit is contained in:
parent
6bcd72e241
commit
85d8e7fcb1
1 changed files with 6 additions and 6 deletions
|
@ -283,13 +283,13 @@ check_trade(void)
|
|||
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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue