Re: [NEWBIE][CODE] invalid_race/invalid_class

From: Peter Ajamian (peter@pajamian.dhs.org)
Date: 03/10/01


Jared Noble wrote:
>
> int invalid_class(struct char_data *ch, struct obj_data *obj) {
>   if ((IS_OBJ_STAT(obj, ITEM_ANTI_CLERIC) && IS_CLERIC(ch)) ||
>         (IS_OBJ_STAT(obj, ITEM_ANTI_THIEF) && IS_THIEF(ch)) ||
>         (IS_OBJ_STAT(obj, ITEM_ANTI_WARRIOR) && IS_WARRIOR(ch)) ||
>         (IS_OBJ_STAT(obj, ITEM_ANTI_MAGIC_USER) && IS_MAGIC_USER(ch)) ||
>         (IS_OBJ_STAT(obj, ITEM_ANTI_PALADIN) && IS_PALADIN(ch)) ||
>         (IS_OBJ_STAT(obj, ITEM_ANTI_RANGER) && IS_RANGER(ch)) ||
>         (IS_OBJ_STAT(obj, ITEM_ANTI_DRUID) && IS_DRUID(ch)))
>         return 1;
>   else
>         return 0;
> }
>
> And here are the errors:
>
> make ../bin/circle
> gcc -g -O2 -Wall  -c class.c
> class.c: In function `invalid_class':
> class.c:2547: parse error before `{'
> class.c:2547: parse error before `)'
> class.c:2551: warning: control reaches end of non-void function
> *** Error code 1
>
> I have gone through the WTFAQ instructions on setting up classes. Much of
> it is outdated of course. But I've been playing around enough that I'm more
> then sure I have everything defined appropriately. Anybody have any
> suggestions?

The code looks fine to me (at a glance), what are the #defines
for IS_OBJ_STAT(), ITEM_ANTI_*, and IS_*()?

Regards, Peter

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/04/01 PST