I have been working to add classes and races to my mud. Everything has gone ok for the most part, but now I am trying to define what race is allowed to be what class. In doing so, I have received the following error:
class.c: In function find_class_bitvector:
class.c:145: warning: passing argument 1 of parse_class makes pointer from integer without a cast
class.c:145: error: too few arguments to function âparse_classâ
I am still learning to code, and overall it is moving along, but after looking at this problem for hours and being unable to figure it out I figured maybe someone can point me in the right direction. The following is a copy of the basic code I am trying to implement. If someone can look it over and maybe point out where the problem is and what I am doing wrong it would be greatly appreciated.
Thank you,
Dustin
Code:
int parse_class(struct char_data *ch, char arg) {
arg = LOWER(arg);
switch (arg) {
case 'a':
if (GET_RACE(ch) == RACE_DWARF || (GET_RACE(ch) == RACE_HUMAN)) {
return CLASS_BARBARIAN;
} else {
return CLASS_UNDEFINED;
}
break;
case 'b':
if (GET_RACE(ch) == RACE_HUMAN || (GET_RACE(ch) == RACE_HALF_ELF)) {
return CLASS_KNIGHT;
} else {
return CLASS_UNDEFINED;
}
break;
case 'c':
if (GET_RACE(ch) == RACE_DWARF || (GET_RACE(ch) == RACE_ELF)) {
return CLASS_PALADIN;
} else {
return CLASS_UNDEFINED;
}
break;
case 'd':
if (GET_RACE(ch) == RACE_GNOME || (GET_RACE(ch) == RACE_TROLL)) {
return CLASS_ROUGE;
} else {
return CLASS_UNDEFINED;
}
case 'e':
if (GET_RACE(ch) == RACE_GNOME || (GET_RACE(ch) == RACE_HUMAN)) {
return CLASS_WARLOCK;
} else {
return CLASS_UNDEFINED;
}
default:
return CLASS_UNDEFINED;
}
}