mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 16:45:20 +02:00
RemotePlayer: make peer ID always reflect the validity of PlayerSAO (#14317)
Upon disconnect, RemotePlayer still had a peer ID assigned even though the PlayerSAO object was maked as gone (for removal). This commit makes that the following always holds true: (!sao || sao->isGone()) === (peer_id == PEER_ID_INEXISTENT)
This commit is contained in:
@@ -326,7 +326,7 @@ int ObjectRef::l_set_wielded_item(lua_State *L)
|
||||
|
||||
bool success = sao->setWieldedItem(item);
|
||||
if (success && sao->getType() == ACTIVEOBJECT_TYPE_PLAYER) {
|
||||
getServer(L)->SendInventory((PlayerSAO *)sao, true);
|
||||
getServer(L)->SendInventory(((PlayerSAO *)sao)->getPlayer(), true);
|
||||
}
|
||||
lua_pushboolean(L, success);
|
||||
return 1;
|
||||
|
Reference in New Issue
Block a user