Re: Adding Levels with bpl17

From: Juliano Ravasi Ferraz (jferraz@linkway.com.br)
Date: 07/21/00


Webremedies wrote:
>
> Ok i realize, unless I am mistaken, saving_throws needs to be added for
> each additional level, stock with 34 levels, I am going to bump up to 200,
> now I have been able to complete this, without changing thaco, and the
> experience chart..
> i set lvl_impl to 206 which is also in the saving throws, 200 mortal, 201-206 - imms.
> i get this when compiling and alot displayed below is only a few:
> act.offensive.c: In function `do_kill':
> act.offensive.c:137: warning: comparison is always true due to limited
> range of data type

Look at 'structs.h', member 'level' of structure 'char_player_data':

struct char_player_data {
   /* ... */
   byte level;         /* PC / NPC's level                     */
   /* ... */
};

It's data type is 'byte', that is a typedef to 'char'. 'char' (or
'signed char') is a data type of 8 bits, that goes from -127 (10000000)
to 126 (01111111). This means that ANY value of 'level' will be less
than 201.

Solution 1:
If you have no playerfile at this moment, change the data type for level
to 'sh_int' (a typedef to 'signed short int'). This will allow 'level'
to be any value from -32768 to 32767.

Solution 2:
Change the data type for level to 'ubyte' (unsigned char). This will
allow 'level' to be any value from 0 to 255, and will not ruin your
playerfile.

--
----=[ Juliano Ravasi Ferraz ]=----=[ jferraz@linkway.com.br ]=----
     Rayon Eletrônica e Informática Ltda. - Linkway Descalvado

"Instant gratification takes too long." - Carrie Fisher


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 04/10/01 PDT