1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-11 17:51:04 +00:00

Clients inform server on wielded item

This is done with the new TOSERVER_PLAYERITEM message, that informs the
server on the index of the wielded item.
This commit is contained in:
Giuseppe Bilotta 2011-08-10 21:43:40 +02:00
parent 91d1186cbb
commit ecd5c5f920
4 changed files with 42 additions and 0 deletions

View file

@ -3381,6 +3381,14 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
<<std::endl;
SendChatMessage(peer_id, L"Password change successful");
}
else if (command == TOSERVER_PLAYERITEM)
{
if (datasize < 2+2)
return;
u16 item = readU16(&data[2]);
player->wieldItem(item);
}
else
{
derr_server<<"WARNING: Server::ProcessData(): Ignoring "