aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSmallJoker <mk939@ymail.com>2018-04-01 22:50:26 +0200
committerLoïc Blot <nerzhul@users.noreply.github.com>2018-04-02 17:18:48 +0200
commite98fd934ce17a7af0b4629fc88158373303c88a0 (patch)
tree335832f7c10ddd0b301fcfc77c05addf5ee8274f /src
parent9fa547bb8013e78991c362b73111a134216307a0 (diff)
downloadminetest-e98fd934ce17a7af0b4629fc88158373303c88a0.tar.gz
minetest-e98fd934ce17a7af0b4629fc88158373303c88a0.tar.bz2
minetest-e98fd934ce17a7af0b4629fc88158373303c88a0.zip
'fix' LINT, use InventoryLocation==
Diffstat (limited to 'src')
-rw-r--r--src/inventorymanager.cpp21
1 files changed, 7 insertions, 14 deletions
diff --git a/src/inventorymanager.cpp b/src/inventorymanager.cpp
index 5c2163db3..6c87255f3 100644
--- a/src/inventorymanager.cpp
+++ b/src/inventorymanager.cpp
@@ -245,8 +245,7 @@ void IMoveAction::apply(InventoryManager *mgr, ServerActiveObject *player, IGame
*/
bool ignore_rollback = (
from_inv.type == InventoryLocation::PLAYER &&
- to_inv.type == InventoryLocation::PLAYER &&
- from_inv.name == to_inv.name);
+ from_inv == to_inv);
/*
Collect information of endpoints
@@ -263,8 +262,7 @@ void IMoveAction::apply(InventoryManager *mgr, ServerActiveObject *player, IGame
// Move occurs in the same detached inventory
if (from_inv.type == InventoryLocation::DETACHED &&
- to_inv.type == InventoryLocation::DETACHED &&
- from_inv.name == to_inv.name) {
+ from_inv == to_inv) {
src_can_take_count = PLAYER_TO_SA(player)->detached_inventory_AllowMove(
*this, try_take_count, player);
dst_can_put_count = src_can_take_count;
@@ -290,8 +288,7 @@ void IMoveAction::apply(InventoryManager *mgr, ServerActiveObject *player, IGame
// Both endpoints are nodemeta
// Move occurs in the same nodemeta inventory
if (from_inv.type == InventoryLocation::NODEMETA &&
- to_inv.type == InventoryLocation::NODEMETA &&
- from_inv.p == to_inv.p) {
+ from_inv == to_inv) {
src_can_take_count = PLAYER_TO_SA(player)->nodemeta_inventory_AllowMove(
*this, try_take_count, player);
dst_can_put_count = src_can_take_count;
@@ -316,8 +313,7 @@ void IMoveAction::apply(InventoryManager *mgr, ServerActiveObject *player, IGame
// Move occurs in the same player inventory
if (from_inv.type == InventoryLocation::PLAYER &&
- to_inv.type == InventoryLocation::PLAYER &&
- from_inv.name == to_inv.name) {
+ from_inv == to_inv) {
src_can_take_count = PLAYER_TO_SA(player)->player_inventory_AllowMove(
*this, try_take_count, player);
dst_can_put_count = src_can_take_count;
@@ -472,8 +468,7 @@ void IMoveAction::apply(InventoryManager *mgr, ServerActiveObject *player, IGame
// Both endpoints are same detached
if (from_inv.type == InventoryLocation::DETACHED &&
- to_inv.type == InventoryLocation::DETACHED &&
- from_inv.name == to_inv.name) {
+ from_inv == to_inv) {
PLAYER_TO_SA(player)->detached_inventory_OnMove(
*this, count, player);
} else {
@@ -493,8 +488,7 @@ void IMoveAction::apply(InventoryManager *mgr, ServerActiveObject *player, IGame
// Both endpoints are same nodemeta
if (from_inv.type == InventoryLocation::NODEMETA &&
- to_inv.type == InventoryLocation::NODEMETA &&
- from_inv.p == to_inv.p) {
+ from_inv == to_inv) {
PLAYER_TO_SA(player)->nodemeta_inventory_OnMove(
*this, count, player);
} else {
@@ -514,8 +508,7 @@ void IMoveAction::apply(InventoryManager *mgr, ServerActiveObject *player, IGame
// Both endpoints are same player inventory
if (from_inv.type == InventoryLocation::PLAYER &&
- to_inv.type == InventoryLocation::PLAYER &&
- from_inv.name == to_inv.name) {
+ from_inv == to_inv) {
PLAYER_TO_SA(player)->player_inventory_OnMove(
*this, count, player);
} else {