Fixed chest contents not immediately updating to all players

This commit is contained in:
Perttu Ahola 2011-04-04 18:29:44 +03:00
parent 7df125c249
commit 042834b09d
2 changed files with 15 additions and 2 deletions

View File

@ -203,6 +203,9 @@ FIXME: Server sometimes goes into some infinite PeerNotFoundException loop
TODO: Player health points
- When player dies, throw items on map
FIXME: If something is removed from craftresult with a right click,
it is only possible to get one item from it should give 4
Objects:
--------

View File

@ -2741,9 +2741,19 @@ void Server::inventoryModified(InventoryContext *c, std::string id)
p.Y = stoi(fn.next(","));
p.Z = stoi(fn.next(","));
assert(c->current_player);
RemoteClient *client = getClient(c->current_player->peer_id);
v3s16 blockpos = getNodeBlockPos(p);
client->SetBlockNotSent(blockpos);
/*RemoteClient *client = getClient(c->current_player->peer_id);
client->SetBlockNotSent(blockpos);*/
for(core::map<u16, RemoteClient*>::Iterator
i = m_clients.getIterator();
i.atEnd()==false; i++)
{
RemoteClient *client = i.getNode()->getValue();
client->SetBlockNotSent(blockpos);
}
return;
}