Fix inventory segfault when rollback recording is disabled
authorPerttu Ahola <celeron55@gmail.com>
Sat, 28 Jul 2012 11:44:18 +0000 (14:44 +0300)
committerPerttu Ahola <celeron55@gmail.com>
Sat, 28 Jul 2012 11:44:18 +0000 (14:44 +0300)
src/inventorymanager.cpp

index 85668d6455f6dd344a9872d5ca8a3153e0e3f66d..7fc8c8ce4539c3f288ae565be993421ea9d24d0d 100644 (file)
@@ -355,7 +355,7 @@ void IMoveAction::apply(InventoryManager *mgr, ServerActiveObject *player, IGame
        /*
                Record rollback information
        */
-       if(!ignore_rollback)
+       if(!ignore_rollback && gamedef->rollback())
        {
                IRollbackReportSink *rollback = gamedef->rollback();
 
@@ -628,7 +628,7 @@ void IDropAction::apply(InventoryManager *mgr, ServerActiveObject *player, IGame
        /*
                Record rollback information
        */
-       if(!ignore_src_rollback)
+       if(!ignore_src_rollback && gamedef->rollback())
        {
                IRollbackReportSink *rollback = gamedef->rollback();