[Fix] GMMove Update Edge Case With Clients (#4686)

* [Fix] GMMove with clients

* Exclude clients entirely for position update caching
This commit is contained in:
Chris Miles 2025-02-15 16:20:37 -06:00 committed by GitHub
parent 02e2f6771c
commit e88ea24966
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -851,7 +851,7 @@ void MobMovementManager::SendCommandToClients(
_impl->Stats.TotalSentPosition++; _impl->Stats.TotalSentPosition++;
} }
if (c->m_last_seen_mob_position.contains(mob->GetID())) { if (!mob->IsClient() && c->m_last_seen_mob_position.contains(mob->GetID())) {
if (c->m_last_seen_mob_position[mob->GetID()] == mob->GetPosition() && anim == 0) { if (c->m_last_seen_mob_position[mob->GetID()] == mob->GetPosition() && anim == 0) {
LogPositionUpdate( LogPositionUpdate(
"Mob [{}] has already been sent to client [{}] at this position, skipping", "Mob [{}] has already been sent to client [{}] at this position, skipping",
@ -913,7 +913,7 @@ void MobMovementManager::SendCommandToClients(
_impl->Stats.TotalSentPosition++; _impl->Stats.TotalSentPosition++;
} }
if (c->m_last_seen_mob_position.contains(mob->GetID())) { if (!mob->IsClient() && c->m_last_seen_mob_position.contains(mob->GetID())) {
if (c->m_last_seen_mob_position[mob->GetID()] == mob->GetPosition() && anim == 0) { if (c->m_last_seen_mob_position[mob->GetID()] == mob->GetPosition() && anim == 0) {
LogPositionUpdate( LogPositionUpdate(
"Mob [{}] has already been sent to client [{}] at this position, skipping", "Mob [{}] has already been sent to client [{}] at this position, skipping",