void Game::follow(const CreaturePtr& creature) { if(!canPerformGameAction() || creature == m_localPlayer || creature == m_followingCreature) return; if(creature && isAttacking()) cancelAttack(); setFollowingCreature(creature); m_protocolGame->sendFollow(creature ? creature->getId() : 0, ++m_seq); }
void Game::follow(CreaturePtr creature) { if(!canPerformGameAction() || creature == m_localPlayer) return; // cancel when following again if(creature && creature == m_followingCreature) creature = nullptr; if(creature && isAttacking()) cancelAttack(); setFollowingCreature(creature); m_localPlayer->stopAutoWalk(); if(m_protocolVersion >= 963) { if(creature) m_seq = creature->getId(); } else m_seq++; m_protocolGame->sendFollow(creature ? creature->getId() : 0, m_seq); }
void Game::requestTrade(const ItemPtr& item, const CreaturePtr& creature) { if(!canPerformGameAction() || !item || !creature) return; m_protocolGame->sendRequestTrade(item->getPosition(), item->getId(), item->getStackpos(), creature->getId()); }
void Map::addCreature(const CreaturePtr& creature) { m_knownCreatures[creature->getId()] = creature; }