I tried several times to apply the gm-command cometome to a selected NPC and failed.
Looking into the code I have seen why:
[FONT=‘courier new’] /*
ComeToMe command REQUIRED for 3rd party scripting library to have access to PointMovementGenerator
Without this function 3rd party scripting library will get linking errors (unresolved external)
when attempting to use the PointMovementGenerator
/
static bool HandleComeToMeCommand(ChatHandler handler, char const* args)
{
char const* newFlagStr = strtok((char*)args, " ");
if (!newFlagStr)
return false;[/FONT]
[FONT=‘courier new’] Creature* caster = handler->getSelectedCreature();
if (!caster)
{
handler->SendSysMessage(LANG_SELECT_CREATURE);
handler->SetSentErrorMessage(true);
return false;
}[/FONT]
[FONT=‘courier new’] Player* player = handler->GetSession()->GetPlayer();[/FONT]
[FONT=‘courier new’] caster->GetMotionMaster()->MovePoint(0, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ());[/FONT]
[FONT=‘courier new’] return true;
}[/FONT]
The command needs an argument (ANY argument will fit!). This is saved in newFlagStr but never used.
Why is there an argument needed ? Because of this ‘3rd party scripting library’ that is in the comment ?
If you use the command like .cometome blah it is working fine