]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/rollback_interface.cpp
Fix codestyle since CSM Camera API
[dragonfireclient.git] / src / rollback_interface.cpp
index bffe0a82c9b7caa6764424a90bfdfa0f7fd43e6c..40a33a51da470010c3f4570dd53133d6ad1e10ce 100644 (file)
@@ -22,6 +22,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "util/serialize.h"
 #include "util/string.h"
 #include "util/numeric.h"
+#include "util/basic_macros.h"
 #include "map.h"
 #include "gamedef.h"
 #include "nodedef.h"
@@ -32,8 +33,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "inventory.h"
 #include "mapblock.h"
 
-#define PP(x) "("<<(x).X<<","<<(x).Y<<","<<(x).Z<<")"
-
 
 RollbackNode::RollbackNode(Map *map, v3s16 p, IGameDef *gamedef)
 {
@@ -191,7 +190,6 @@ bool RollbackAction::applyRevert(Map *map, InventoryManager *imgr, IGameDef *gam
                case TYPE_MODIFY_INVENTORY_STACK: {
                        InventoryLocation loc;
                        loc.deSerialize(inventory_location);
-                       std::string real_name = gamedef->idef()->getAlias(inventory_stack.name);
                        Inventory *inv = imgr->getInventory(loc);
                        if (!inv) {
                                infostream << "RollbackAction::applyRevert(): Could not get "
@@ -212,10 +210,12 @@ bool RollbackAction::applyRevert(Map *map, InventoryManager *imgr, IGameDef *gam
                                        << inventory_location << std::endl;
                                return false;
                        }
+                       
                        // If item was added, take away item, otherwise add removed item
                        if (inventory_add) {
                                // Silently ignore different current item
-                               if (list->getItem(inventory_index).name != real_name)
+                               if (list->getItem(inventory_index).name !=
+                                               gamedef->idef()->getAlias(inventory_stack.name))
                                        return false;
                                list->takeItem(inventory_index, inventory_stack.count);
                        } else {