2 hours ago, Ceetros said:
Pera, passei da source errada
bool Monster::selectTarget(Creature* creature){#ifdef __DEBUG__ std::cout << "Selecting target... " << std::endl;#endif if(!isTarget(creature)) return false; CreatureList::iterator it = std::find(targetList.begin(), targetList.end(), creature); if(it == targetList.end()) { //Target not found in our target list.#ifdef __DEBUG__ std::cout << "Target not found in targetList." << std::endl;#endif return false; } if (isPassive() && !hasBeenAttacked(creature->getID())) { return false; } if(!isHostile() && getHealth() == getMaxHealth() && !isSummon() && !isTarget(creature)) { return false; } } if (isTarget(creature) && !isHostile() && !isSummon()) { Dispatcher::getInstance().addTask(createTask( boost::bind(&Game::checkCreatureAttack, &g_game, getID()))); return setFollowCreature(creature, true); } if((isHostile() || isSummon() || !isHostile() && getHealth() != getMaxHealth() || !isHostile() && isTarget(creature) || isPassive()) && setAttackedCreature(creature) && !isSummon()) Dispatcher::getInstance().addTask(createTask( boost::bind(&Game::checkCreatureAttack, &g_game, getID()))); return setFollowCreature(creature, true);}






info
Registrado: 31/12/69
Posts: 0
Reputação: 0
Pera, passei da source errada
bool Monster::selectTarget(Creature* creature){#ifdef __DEBUG__ std::cout << "Selecting target... " << std::endl;#endif if(!isTarget(creature)) return false; CreatureList::iterator it = std::find(targetList.begin(), targetList.end(), creature); if(it == targetList.end()) { //Target not found in our target list.#ifdef __DEBUG__ std::cout << "Target not found in targetList." << std::endl;#endif return false; } if (isPassive() && !hasBeenAttacked(creature->getID())) { return false; } if(!isHostile() && getHealth() == getMaxHealth() && !isSummon() && !isTarget(creature)) { return false; } } if (isTarget(creature) && !isHostile() && !isSummon()) { Dispatcher::getInstance().addTask(createTask( boost::bind(&Game::checkCreatureAttack, &g_game, getID()))); return setFollowCreature(creature, true); } if((isHostile() || isSummon() || !isHostile() && getHealth() != getMaxHealth() || !isHostile() && isTarget(creature) || isPassive()) && setAttackedCreature(creature) && !isSummon()) Dispatcher::getInstance().addTask(createTask( boost::bind(&Game::checkCreatureAttack, &g_game, getID()))); return setFollowCreature(creature, true);}