[crossfire] Item merging bug

Nicolas Weeger nicolas.weeger at laposte.net
Mon Aug 30 15:12:51 CDT 2010


Hello.


On trunk there is a merging bug with items in eg a unique map.


How to reproduce:
- enter a unique map
- drop some item
- reset the map
- drop more of the same item

Dropped item won't merge with the one on the floor. But if you pick both items, 
they correctly merge.


Tracing the issue, it's because of FLAG_OBJ_ORIGINAL which is set on the item 
on the map.
That flag is cleared when the player picks up the item, so items can merge.
On the other hand, when dropping, that flag is not ignored, so items won't 
merge.


From what I can gather, this flag is used with overlays, to distinguish between 
items on a map initially (and thus which will be restored later) and others 
added to the map.


I admit to not being sure of the fix here.

One solution is to ignore that flag when merging, ensuring it is cleared after 
merge. This would mean that, if there are 5 platinum coins on a map, and I 
drop 3 more, the map resets, those 8 coins would stay, and I'd get 5 more 
because of the initial map... That doesn't seem too strange, especially 
considering that merely picking those 5 coins then dropping them means they 
will indeed be restored.

I'm not totally sure of the possible other side effects, though. But the flag is 
not used too much, so it shouldn't be too bard.



Other solution is to remove overlays totally. Not sure if they are used or 
not.



Nicolas
-- 
Mon p'tit coin du web - http://nicolas.weeger.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: This is a digitally signed message part.
Url : http://mailman.metalforge.org/pipermail/crossfire/attachments/20100830/3da2be07/attachment.pgp 


More information about the crossfire mailing list