mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-15 09:25:37 +02:00
Make inventory GUI do sane things when server-side inventory acts unusually
This commit is contained in:
@@ -66,6 +66,29 @@ struct InventoryLocation
|
||||
name = name_;
|
||||
}
|
||||
|
||||
bool operator==(const InventoryLocation &other) const
|
||||
{
|
||||
if(type != other.type)
|
||||
return false;
|
||||
switch(type){
|
||||
case UNDEFINED:
|
||||
return false;
|
||||
case CURRENT_PLAYER:
|
||||
return true;
|
||||
case PLAYER:
|
||||
return (name == other.name);
|
||||
case NODEMETA:
|
||||
return (p == other.p);
|
||||
case DETACHED:
|
||||
return (name == other.name);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
bool operator!=(const InventoryLocation &other) const
|
||||
{
|
||||
return !(*this == other);
|
||||
}
|
||||
|
||||
void applyCurrentPlayer(const std::string &name_)
|
||||
{
|
||||
if(type == CURRENT_PLAYER)
|
||||
|
Reference in New Issue
Block a user