[CF-Devel] 'Drop' bug

crossfire-devel at archives.real-time.com crossfire-devel at archives.real-time.com
Sun Oct 26 22:11:58 CST 2003


Nicolas Weeger wrote:
>
     
      Hi.
     
     >
     
     
     >
     
      There's a bug in item matching when dropping:
     
     >
     
      I had a bunch of wands, some identified, some not.
     
     >
     
      So i did 'drop wand of' to drop the identified ones.
     
     >
     
      Except all were dropped, even the non identified...
     
     >
     
      (they shouldn't imo, but maybe i'm wrong)
     
     
  Well, they weren't dropped because the string logic was pulling in additional 
information on the object the player didn't know (eg, if one as a wand of 
fireball, and you did a 'drop fireball', that wand wouldn't get dropped because 
as far as all the code is concerned, it is just a wand).

  The problem was in that for the strncasecmp(), it was taking the shorter 
length of either the name or passed in string.  So in the case of unidentified 
objects, the 'wand' would match the start of 'wand of'.

  I agree with you that that logic is wrong.  So I'm going to change it so it 
only uses the length of the passed in name.



_______________________________________________
crossfire-devel mailing list
     
     crossfire-devel at lists.real-time.com
     
     
     https://mailman.real-time.com/mailman/listinfo/crossfire-devel
     
     
    


More information about the crossfire mailing list