special procedures

Date: 07/12/95

#define SPECIAL(name) \
  int (name)(struct char_data *ch, void *me, int cmd, char *arg)
(that's close enough, this part    ^^^^^^^^^  is the important part)
The reason its void is because the room or mob or obj that the special
procedure is for gets passed to it by interpreter.c (so sometimes a
char_data gets passed, for mob specprocs, sometimes an obj_data gets
passed, for object specprocs...) That's great, but the problem I'm 
running into is that when I try to use me in a specproc it complains
that I'm mismatching types. Even though at run time the proper variable
type will have been passed to *me, trying to do GET_MOB_VNUM(me) won't
even get by the compiler. One way I thought of to get by this is to
change SPECIAL into SPECIAL_MOB, SPECIAL_OBJ, etc. and explicitly
state which form *me takes for each of those. Any other possible 
suggestions? I don't want to try compiling without the -Wall switch.

This archive was generated by hypermail 2b30 : 12/07/00 PST