Node highlighting.
[oweals/minetest.git] / src / rollback_interface.cpp
index 74f3e691c47d93c371d52ac2a19c056c86f9b2a9..808b07fed9545a7b5032d54e6898a6ca29e2a6df 100644 (file)
@@ -1,6 +1,6 @@
 /*
 Minetest
-Copyright (C) 2012 celeron55, Perttu Ahola <celeron55@gmail.com>
+Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
 
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU Lesser General Public License as published by
@@ -340,7 +340,13 @@ bool RollbackAction::applyRevert(Map *map, InventoryManager *imgr, IGameDef *gam
                                if(n_old.meta != ""){
                                        if(!meta){
                                                meta = new NodeMetadata(gamedef);
-                                               map->setNodeMetadata(p, meta);
+                                               if(!map->setNodeMetadata(p, meta)){
+                                                       delete meta;
+                                                       infostream<<"RollbackAction::applyRevert(): "
+                                                                       <<"setNodeMetadata failed at "
+                                                                       <<PP(p)<<" for "<<n_old.name<<std::endl;
+                                                       return false;
+                                               }
                                        }
                                        std::istringstream is(n_old.meta, std::ios::binary);
                                        meta->deSerialize(is);