[CF-Devel] AC and WC use signed chars. Wrapping can happen EASILY.

Peter Mardahl peterm at tonks.EECS.Berkeley.EDU
Fri May 11 02:42:57 CDT 2001



>
     
      If it was a real overflow, further holy possessions would lower the wc/ac
     
     >
     
      further, but they don't. So I guess the server handles it correctly, but mayb
     
     >
     
      the client has only 8 bits for it?
     
     
A 3 minute examination of the code shows this:
typedef struct liv { /* Mostly used by "alive" objects */
  sint8         Str,Dex,Con,Wis,Cha,Int,Pow;
  sint8         wc,ac;          /* Weapon Class and Armour Class */
  sint16        hp;             /* Hit Points. */
  sint16        maxhp;
  sint16        sp;             /* Spell points.  Used to cast mage spells. */

wc and ac are 8 bit signed ints.

Wrapping can and does occur.

Your guesses are borne out neither by the code nor by my
observation "in the field".

PeterM


>
     
      Bye
     
     >
     
      Jochen
     
     >
     
     
     >
     
      -- 
     
     >
     
      E-Mail: Jochen Suckfuell <
      
      crossfire at suckfuell.net
      
      >
     
     >
     
      _______________________________________________
     
     >
     
      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