From c772e0e18c90e48f237e37a45230a1dacd945786 Mon Sep 17 00:00:00 2001 From: Vincent Glize Date: Sat, 1 Jul 2017 14:07:40 +0200 Subject: C++11 cleanup inventorymanager (#6077) * C++11 cleanup inventorymanager --- src/network/serverpackethandler.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/network') diff --git a/src/network/serverpackethandler.cpp b/src/network/serverpackethandler.cpp index da421b36d..a2882b2e7 100644 --- a/src/network/serverpackethandler.cpp +++ b/src/network/serverpackethandler.cpp @@ -908,7 +908,7 @@ void Server::handleCommand_InventoryAction(NetworkPacket* pkt) std::istringstream is(datastring, std::ios_base::binary); // Create an action InventoryAction *a = InventoryAction::deSerialize(is); - if (a == NULL) { + if (!a) { infostream << "TOSERVER_INVENTORY_ACTION: " << "InventoryAction::deSerialize() returned NULL" << std::endl; @@ -927,7 +927,7 @@ void Server::handleCommand_InventoryAction(NetworkPacket* pkt) /* Handle restrictions and special cases of the move action */ - if (a->getType() == IACTION_MOVE) { + if (a->getType() == IAction::Move) { IMoveAction *ma = (IMoveAction*)a; ma->from_inv.applyCurrentPlayer(player->getName()); @@ -982,7 +982,7 @@ void Server::handleCommand_InventoryAction(NetworkPacket* pkt) /* Handle restrictions and special cases of the drop action */ - else if (a->getType() == IACTION_DROP) { + else if (a->getType() == IAction::Drop) { IDropAction *da = (IDropAction*)a; da->from_inv.applyCurrentPlayer(player->getName()); @@ -1018,7 +1018,7 @@ void Server::handleCommand_InventoryAction(NetworkPacket* pkt) /* Handle restrictions and special cases of the craft action */ - else if (a->getType() == IACTION_CRAFT) { + else if (a->getType() == IAction::Craft) { ICraftAction *ca = (ICraftAction*)a; ca->craft_inv.applyCurrentPlayer(player->getName()); -- cgit v1.2.3