purgeplay.c: In function `purge': purgeplay.c:60: warning: comparison is always false due to limited range of data type i get that, i looked at purgeplay.c line 60 it's -> if (player.level < 0 || player.level > LVL_IMPL) { okay = 0; strcpy(reason, "Invalid level"); i changed all levels in structs.h to ubyte to get rid of all the other errors, but this one still applies? any ideas? oh btw - thannks for the help 95% of all errors, are gone. thanks. surg -----Original Message----- From: Juliano Ravasi Ferraz <jferraz@linkway.com.br> To: CIRCLE@post.queensu.ca <CIRCLE@post.queensu.ca> Date: July 21, 2000 4:09 PM Subject: Re: [CIRCLE] Adding Levels with bpl17 >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 | > +------------------------------------------------------------+ +------------------------------------------------------------+ | 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