Fixed issue with isAttacking and isFollowing on older protocols.
Some protocols don't send a cancel attack/follow packet to the client when a creature dies.
This commit is contained in:
parent
54b8e362d5
commit
65d556ef4e
|
@ -1478,7 +1478,7 @@ void Game::setProtocolVersion(int version)
|
||||||
enableFeature(Otc::GameNewFluids);
|
enableFeature(Otc::GameNewFluids);
|
||||||
enableFeature(Otc::GameMessageLevel);
|
enableFeature(Otc::GameMessageLevel);
|
||||||
enableFeature(Otc::GamePlayerStateU16);
|
enableFeature(Otc::GamePlayerStateU16);
|
||||||
enableFeature(Otc::GameNewOutfitProtocol);
|
enableFeature(Otc::GameNewOutfitProtocol); // This might be 790 not 780
|
||||||
}
|
}
|
||||||
|
|
||||||
if(version >= 790) {
|
if(version >= 790) {
|
||||||
|
|
|
@ -286,8 +286,8 @@ public:
|
||||||
bool isOnline() { return m_online; }
|
bool isOnline() { return m_online; }
|
||||||
bool isLogging() { return !m_online && m_protocolGame; }
|
bool isLogging() { return !m_online && m_protocolGame; }
|
||||||
bool isDead() { return m_dead; }
|
bool isDead() { return m_dead; }
|
||||||
bool isAttacking() { return !!m_attackingCreature; }
|
bool isAttacking() { return !!m_attackingCreature && !m_attackingCreature->isRemoved(); }
|
||||||
bool isFollowing() { return !!m_followingCreature; }
|
bool isFollowing() { return !!m_followingCreature && !m_followingCreature->isRemoved(); }
|
||||||
bool isConnectionOk() { return m_protocolGame && m_protocolGame->getElapsedTicksSinceLastRead() < 5000; }
|
bool isConnectionOk() { return m_protocolGame && m_protocolGame->getElapsedTicksSinceLastRead() < 5000; }
|
||||||
|
|
||||||
int getPing() { return m_ping >= 0 ? std::max<int>(m_ping, m_pingTimer.elapsed_millis()) : -1; }
|
int getPing() { return m_ping >= 0 ? std::max<int>(m_ping, m_pingTimer.elapsed_millis()) : -1; }
|
||||||
|
|
Loading…
Reference in New Issue