Merge pull request #677 from shea851/distance_change

Add distance logic to mobs that move
This commit is contained in:
Chris Miles 2017-12-04 08:10:47 -06:00 committed by GitHub
commit 9b4e63fbc7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1480,6 +1480,11 @@ void Mob::SendPositionUpdate(uint8 iSendToSelf) {
CastToClient()->FastQueuePacket(&app, false); CastToClient()->FastQueuePacket(&app, false);
} }
} }
else if (DistanceSquared(last_major_update_position, m_Position) >= (100 * 100)) {
entity_list.QueueClients(this, app, true, true);
last_major_update_position = m_Position;
is_distance_roamer = true;
}
else { else {
entity_list.QueueCloseClients(this, app, (iSendToSelf == 0), RuleI(Range, MobPositionUpdates), nullptr, false); entity_list.QueueCloseClients(this, app, (iSendToSelf == 0), RuleI(Range, MobPositionUpdates), nullptr, false);
} }