]> git.pond.sub.org Git - empserver/commit
lost: Fix to track more than one lost sector per owner
authorMarkus Armbruster <armbru@pond.sub.org>
Mon, 18 Jul 2016 19:14:30 +0000 (21:14 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 6 Aug 2017 18:09:18 +0000 (20:09 +0200)
commit2402f3f2a2402d307e857519aee60f2a96e9bbb2
tree525d8d564c12142441737d26c56d3025a3751c73
parentcbc23ae85832b82618e8c0d198a0b053169b303a
lost: Fix to track more than one lost sector per owner

makelost() overwrites an existing entry for the same thing, else
creates a new one.  It calls findlost() to find existing entries.
findlost() means to look up by coordinates if it's looking for a
sector entry, and by ID if it's looking for a ship, plane, land unit
or nuke entry.  It actually does both for sectors.  Since callers pass
zero ID for sectors, sector entries always match, so at most one gets
created, and additional ones overwrite it.

Broken since the lost table was introduced in 4.0.7.  Fix the flawed
comparison in findlost().

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
src/lib/subs/lostsub.c
tests/actofgod/final.xdump
tests/bridgefall/final.xdump
tests/smoke/final.xdump
tests/smoke/journal.log
tests/update/final.xdump