E
Evil Puncker
Guest
Hi everyone, I'm kinda breaking my head trying to understand how the createSchedulerTask works, as I'm trying to add it here:
so the monster (this) is teleported back to its getMasterPos() 15 seconds after he loses the target, but I tried the above and get the following error:
any help is appreciated, thanks in advance
Using latest tfs.
C++:
void Monster::onAttackedCreatureDisappear(bool)
{
attackTicks = 0;
extraMeleeAttack = true;
createSchedulerTask(15000, std::bind(&Game::internalTeleport, &g_game, this, getMasterPos()));
}
so the monster (this) is teleported back to its getMasterPos() 15 seconds after he loses the target, but I tried the above and get the following error:
Error C2664 'SchedulerTask createSchedulerTask(uint32_t,std::function<void (void)>)': cannot convert argument 2 from 'std::_Binder<std::_Unforced,ReturnValue (__cdecl Game:: )(Thing *,const Position &,bool,uint32_t),Game *,Monster *,const Position &>' to 'std::function<void (void)>' theforgottenserver C:\Users\x\Desktop\forgottenserver-master\src\monster.cpp 125
any help is appreciated, thanks in advance
Using latest tfs.