>To make your code a bit faster, don't put the skill_num check inside >the loop. I assume you set unused classes to CLASS_UNDEFINED. Then >try this approach: >int found = FALSE, i; >if (skill_num < 1) { >send_to_char(ch, "no such skill!\r\n"); >return; >} >for (i = 0;i < MAX_MULTICLASSES && !found; i++) { >if (GET_CLASS(ch, i) == CLASS_UNDEFINED) >continue; >if (GET_CLASS_LEVEL(ch, i) >= >spell_info[skill_num].min_level[(int) GET_CLASS(ch, i)]) >found = TRUE; >} >if (!found) { >send_to_char(ch, "You can't learn that %s!\r\n", SPLSKL(ch)); >return; >} >[do stuff here ; i and skill_num are valid] Thanx :) it works to practice now... but what about the guards... they still don't want to let anyone through... this is how that part of the code looks like, note that i have tried to loop through all of the multiclass slots... /* Allow the people of the guild through. */ if (!IS_NPC(ch) && GET_CLASS(ch, 0) == guild_info[i].pc_class) continue; another thing... i am having trouble casting spells with my mortal, i typ prac, and see armor at very good, and cure light at very good... but it says you don't know of that spell... this is how that part of the code looks like in do_cast for (i = 0; i < MAX_MULTICLASSES && !can_cast; i++) { /* save cpu time */ if (GET_CLASS(ch, i) == CLASS_UNDEFINED) break; if (GET_CLASS_LEVEL(ch, i) > SINFO.min_level[(int) GET_CLASS(ch, i)]) can_cast = TRUE; } thanx for your time Gå före i kön och få din sajt värderad på nolltid med Yahoo! Express -- +---------------------------------------------------------------+ | 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/26/03 PDT