Re: [NEWBIE][CODE] invalid_race/invalid_class

From: Jared Noble (jnoble@inreach.com)
Date: 03/10/01


These things are killing me. I first had trouble with setting up
anti-racial eq and eventually skipped it out of frustration.
Unfortunately, here I am facing the exact same problem but with classes
and this time I cannot skip it. I must have anti_class equipment.

Here is the code:

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?

--
   +---------------------------------------------------------------+
   | 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