[CF-Devel] Bug in stealing code

crossfire-devel at archives.real-time.com crossfire-devel at archives.real-time.com
Wed Jun 2 11:47:55 CDT 2004


Mark Wedel wrote:
>
     
      The patch as provided does violate proper C - you can't legally
     
     >
     
      declare new variables just anyplace - has to be at the head of a
     
     >
     
      block. That is allowed in C++, and many C compilers allow
     
     >
     
      various forms of C++ code.
     
     
I disagree: the current Ansi C standard (C99) does indeed allow to
declare new variables intermixed with "real" statements. (As well
as C++ (//) comments.) Of course, Ansi C89 does not allow it.

Besides this, my code declares the variable at the beginning of a
block. Therefore it should be valid according to both standards.
(My apologies for not using context diffs.)

I tend to declare variables at the beginning of the innermost
possible block. If this is not acceptable, I'll refrain from doing
this and declare them at the beginning of the function.


>
     
      > 3. The character weight in the client does not get updated.
     
     >
     
      >    Even the command 'fix_me' executed from the client does not
     
     >
     
      >    fix it.
     
     >
     
      >
     
     >
     
      >    How should I fix this issue?
     
     >
     
     
     >
     
      Depends on the bug, as I'm not sure exactly what you are
     
     >
     
      reporting. It could be:
     
     [...]
>
     
      3) Player has item stolen, and theif correctly has it in his
     
     >
     
      inventory, but old player still shows higher weight.
     
     
Case 3 does not work correctly (for player and monster
interchanged): Monster steals an item successfully, item gets
removed from player inventory -- you see the item disappearing
from inventory view but the total player weight remains unchanged.

I did ask this question (how to correctly update the player
weight) to fix other places with the same bug: after eating or
throwing items, the player weight does not change.

_______________________________________________
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