so then i would make it This->player->character ???
And then it would look like this?
if (message[0] == '#')
{
std::string usercmd;
std::vector<std::string> userar = util::explode(' ', message);
usercmd = userar.front().substr(1);
userar.erase(userar.begin());
std::string command;
std::vector<std::string> arguments = util::explode(' ', message);
command = arguments.front().substr(1);
arguments.erase(arguments.begin());
if (command.length() >= 6 &&command.compare(0,6,"follow") == 0 && this->player->character->has_pet)
{
this->player->character->pet->attack_command =false;
}
else if (command.length() >= 6 &&command.compare(0,6,"attack") == 0 && this->player->character->has_pet)
{
this->player->character->pet->attack_command =true;
}
}
else if (command.length() >= 7 &&command.compare(0,7,"dismiss") == 0 && this->player->character->has_pet)
{
UTIL_PTR_LIST_FOREACH(this->player->character->map->characters, Character, character)
{
if (this->player->character->InRange(*character))
{
this->player->character->pet->RemoveFromView(*character);
}
}
erase_first(this->player->character->map->npcs, this->player->character->pet);
this->player->character->pet->Release();
this->player->character->has_pet = false;
this->player->character->ServerMsg("NPC left!");
}
--Edit-- Ok i fixed that part but i still get this
Compiling: ..\src\handlers\Talk.cpp
C:\Users\Austin\Desktop\Flash drive\trunk\src\handlers\Talk.cpp: In member function 'bool EOClient::Handle_Talk(PacketFamily, PacketAction, PacketReader&, int)':
C:\Users\Austin\Desktop\Flash drive\trunk\src\handlers\Talk.cpp:140: error: 'command' was not declared in this scope
Process terminated with status 1 (0 minutes, 1 seconds)
1 errors, 0 warnings
I get this on the line that #dismiss starts with