]> git.lizzy.rs Git - minetest.git/blobdiff - src/inventorymanager.h
Add a setting to enable always flying fast
[minetest.git] / src / inventorymanager.h
index dae14f1a6c25da91ddeba69142039933d71d3800..f81f5b972b8c4eceb49187893870ace0b6af07f8 100644 (file)
@@ -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)