mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 08:35:20 +02:00
Send cumulated inventory changes only each step (#8856)
Applies to player and detached inventories
This commit is contained in:
@@ -1454,6 +1454,19 @@ void ServerEnvironment::step(float dtime)
|
||||
++i;
|
||||
}
|
||||
}
|
||||
|
||||
// Send outdated player inventories
|
||||
for (RemotePlayer *player : m_players) {
|
||||
if (player->getPeerId() == PEER_ID_INEXISTENT)
|
||||
continue;
|
||||
|
||||
PlayerSAO *sao = player->getPlayerSAO();
|
||||
if (sao && player->inventory.checkModified())
|
||||
m_server->SendInventory(sao, true);
|
||||
}
|
||||
|
||||
// Send outdated detached inventories
|
||||
m_server->sendDetachedInventories(PEER_ID_INEXISTENT, true);
|
||||
}
|
||||
|
||||
u32 ServerEnvironment::addParticleSpawner(float exptime)
|
||||
|
Reference in New Issue
Block a user