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>
This commit is contained in:
parent
cbc23ae858
commit
2402f3f2a2
6 changed files with 25 additions and 4 deletions
|
@ -109,7 +109,7 @@ findlost(int type, natid owner, int id, coord x, coord y, int free)
|
|||
if (lost.lost_owner == owner && type == lost.lost_type) {
|
||||
if (type == EF_SECTOR && lost.lost_x == x && lost.lost_y == y)
|
||||
return n;
|
||||
else if (lost.lost_id == id)
|
||||
if (type != EF_SECTOR && lost.lost_id == id)
|
||||
return n;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -252,7 +252,14 @@ uid owner type amount price maxbidder markettime xbuy ybuy xsell ysell
|
|||
/config
|
||||
config lost
|
||||
timestamp owner type id x y
|
||||
0 1 0 0 1 7
|
||||
0 1 0 0 3 7
|
||||
0 1 0 0 5 7
|
||||
0 1 0 0 7 7
|
||||
0 1 0 0 9 7
|
||||
0 1 0 0 11 7
|
||||
0 3 0 0 5 -7
|
||||
0 2 0 0 -2 2
|
||||
0 3 0 0 2 -2
|
||||
0 3 1 0 1 -1
|
||||
0 3 1 1 1 -1
|
||||
|
|
|
@ -67,7 +67,7 @@ uid owner type amount price maxbidder markettime xbuy ybuy xsell ysell
|
|||
/config
|
||||
config lost
|
||||
timestamp owner type id x y
|
||||
0 2 0 0 -1 1
|
||||
0 2 0 0 -1 -1
|
||||
0 1 3 0 0 -2
|
||||
0 1 2 0 0 -2
|
||||
0 1 3 1 0 -2
|
||||
|
@ -75,7 +75,7 @@ timestamp owner type id x y
|
|||
0 1 2 2 0 -2
|
||||
0 1 4 2 0 -2
|
||||
0 1 4 0 0 -2
|
||||
0 1 0 0 3 1
|
||||
0 1 0 0 0 -2
|
||||
0 2 3 10 1 -3
|
||||
0 2 2 10 1 -3
|
||||
0 2 3 11 1 -3
|
||||
|
@ -83,6 +83,15 @@ timestamp owner type id x y
|
|||
0 2 2 12 1 -3
|
||||
0 2 4 12 1 -3
|
||||
0 2 4 10 1 -3
|
||||
0 2 0 0 3 -3
|
||||
0 2 0 0 1 -3
|
||||
0 1 0 0 3 1
|
||||
0 2 0 0 2 2
|
||||
0 2 0 0 1 3
|
||||
0 2 0 0 -2 2
|
||||
0 2 0 0 -3 1
|
||||
0 2 0 0 0 2
|
||||
0 2 0 0 -1 1
|
||||
/config
|
||||
config realm
|
||||
cnum realm xl xh yl yh
|
||||
|
|
|
@ -1108,6 +1108,7 @@ uid owner type amount price maxbidder markettime xbuy ybuy xsell ysell
|
|||
/config
|
||||
config lost
|
||||
timestamp owner type id x y
|
||||
0 8 0 0 16 -14
|
||||
0 0 1 2 11 -13
|
||||
0 1 3 1 11 -13
|
||||
0 1 3 2 10 -14
|
||||
|
|
|
@ -14088,9 +14088,10 @@
|
|||
Play#0 input xdump lost *
|
||||
Play#0 command xdump
|
||||
Play#0 output Play#0 1 XDUMP lost 0
|
||||
Play#0 output Play#0 1 0 8 0 0 16 -14
|
||||
Play#0 output Play#0 1 0 1 3 1 11 -13
|
||||
Play#0 output Play#0 1 0 1 3 2 10 -14
|
||||
Play#0 output Play#0 1 /2
|
||||
Play#0 output Play#0 1 /3
|
||||
Play#0 output Play#0 6 0 640
|
||||
Play#0 input xdump realm 0
|
||||
Play#0 command xdump
|
||||
|
|
|
@ -427,6 +427,9 @@ uid owner type amount price maxbidder markettime xbuy ybuy xsell ysell
|
|||
/config
|
||||
config lost
|
||||
timestamp owner type id x y
|
||||
0 4 0 0 -16 -8
|
||||
0 4 0 0 -14 -8
|
||||
0 4 0 0 -16 -6
|
||||
0 4 0 0 -8 -6
|
||||
/config
|
||||
config realm
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue