Re: [code] GET_CLASS for multiclassing...

From: peter dahlgren (peter_dahlgren2002@yahoo.se)
Date: 11/10/02


>and then simple checks like this

>for (i = 0; i < NUM_MULTICLASSES; i++) {
>if (GET_CLASS(ch, i) == 0)
>continue;
>if (is_class(vict, GET_CLASS(ch, i)) != -1)
>/* ch and vict has at least one common class */
>do_stuff(tm)
>}

>Welcor

do you mean if(GET_CLASS(ch, i) == -1) ?
because 0 is CLASS_WARRIOR...
or maybe it should be 0, i'm confused, help? :)
thanx for your help :)
by the way, i made a function that searches the current position in the class array... the position where the player gains levels that is...
here goes
int search_cur_class(struct char_data *ch)
{
 for(int i = 0; i < 6; i++)
     if(GET_CLASS(ch, i) == -1)
       return i-1;
}
i know it's not much to look at, but since the classes goes in order, and -1 is an undefined value in the array, i want it to return the previous vaule, [i-1]
and, how do i make it set all values to -1 except the first class...?

Gratis e-mail resten av livet på: www.yahoo.se/mail
Busenkelt!

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/25/03 PDT