Adding commands seems to work, but when I attempt to use them I get problems...here is the function to do the commands:
1 2 3 4 5 6 7 8 9
void animate::do_command(std::string command, std::string argument) {
command = strtolower(command);
argument = strtolower(argument);
for(size_t i = 0; i < mud_info->global_commands.size(); ++i) {
if(mud_info->global_commands.at(i).first.find(command) == 0) { //if we see part of the command
(*(mud_info->global_commands.at(i).second))(argument); //do the command we find
}
}
}
This gives me two errors:
Error 28 error C2064: term does not evaluate to a function taking 1 arguments
Error 27 error C2171: '*' : illegal on operands of type 'animate_func_ptr '
The problem is the second one mainly, I can't figure out why it is complaining that I can't deference a function pointer...am I screwing something up? If you need more info just ask.
well the problem here is that animate_func_ptr is a pointer to an animate member function. So in order to call it you need an animate object. If mud_info wasn't it, then I don't see one here.