Re: [crossfire] Item merging bug

2010-09-04 Thread Nicolas Weeger
   True.
 
   It just seems to me that the implementation is buggy - if on a unique
 map, it shouldn´t be setting the flag_original value - maybe that is a
 simpler map - to check for that and not set it.


But even if we don't set the flag on a unique map, the issue will still be here 
on non unique maps :)

If a DM saves an overlay in a world map, with a silver coin, and a player 
drops another silver coin, it still won't merge...


I think the 2 fixes are either to remove totally overlays, or just ensure items 
merge even if the ORIGINAL flag is set.




Nicolas
-- 
Mon p'tit coin du web - http://nicolas.weeger.org


signature.asc
Description: This is a digitally signed message part.
___
crossfire mailing list
crossfire@metalforge.org
http://mailman.metalforge.org/mailman/listinfo/crossfire


Re: [crossfire] Item merging bug

2010-09-02 Thread Nicolas Weeger
   As I think about this, I believe the main use of overlays was the weather
 code - so that when it put snow effects, etc, it could know what objects
 were original to the map (eg, the base mountain) and which objects were
 put on top by weather effects.
 
   I believe the reason for this is so that the base map (say the scorn
 town) could reset, but the weather effects would persist across that
 reset.
 
   I don´t think anything is using the weather code - I´m not even sure to
 what extent it still works.

The weather code was removed years ago in trunk.

So I guess that makes overlays removable? :)


Though it can be useful in some cases, like for DMs wanting to leave items 
persisting resets.



Nicolas
-- 
Mon p'tit coin du web - http://nicolas.weeger.org


signature.asc
Description: This is a digitally signed message part.
___
crossfire mailing list
crossfire@metalforge.org
http://mailman.metalforge.org/mailman/listinfo/crossfire


Re: [crossfire] Item merging bug

2010-08-30 Thread Mark Wedel
On 08/30/10 01:12 PM, Nicolas Weeger wrote:
 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.

  As I briefly look at the code, I'm not sure if that flag is really being used 
properly, but I'm not really sure what it is used for now.

  At one time there was the addition of overlay maps to the server, but I don't 
think that was ever really used.

  It seems the only time that makes a different is if SAVE_FLAG_NO_REMOVE is 
set, and that is set when making backup saves of the player file.  And in that 
case, FLAG_OBJ_ORIGINAL should already be cleared, because as you note it is 
cleared when something is picked up.




  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.

  Yep, but I don't think overlays are in use anymore (I could be wrong).  But 
even if that was the intention, it seems broken that it gets set on unique maps 
- if I drop an item in my apartment, I wouldn't think that flag should get set 
on next load, since that object is hardly original (and I don't think original 
to this load was the intention)



 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.

  That would be the approach I'd lean to, but may be harder.  But no reason to 
have unused code sitting about that creates complications.


___
crossfire mailing list
crossfire@metalforge.org
http://mailman.metalforge.org/mailman/listinfo/crossfire