Rollback: Fail on bad precondition instead of causing assertion error
authorkwolekr <kwolekr@minetest.net>
Sat, 15 Aug 2015 18:45:44 +0000 (14:45 -0400)
committerkwolekr <kwolekr@minetest.net>
Sat, 15 Aug 2015 18:51:38 +0000 (14:51 -0400)
src/rollback_interface.cpp

index 028bd0424ee7b0ee5b0f3ddff9e07b4c4e8a5fce..b3f457029bd74e299f9634f1fa4568034993347e 100644 (file)
@@ -210,6 +210,7 @@ bool RollbackAction::applyRevert(Map *map, InventoryManager *imgr, IGameDef *gam
                                        << inventory_index << " too large in "
                                        << "inventory list \"" << inventory_list << "\" in "
                                        << inventory_location << std::endl;
+                               return false;
                        }
                        // If item was added, take away item, otherwise add removed item
                        if (inventory_add) {