Make --migrate update world.mt too
authorSfan5 <sfan5@live.de>
Mon, 9 Sep 2013 18:07:25 +0000 (20:07 +0200)
committerSfan5 <sfan5@live.de>
Mon, 9 Sep 2013 20:50:51 +0000 (22:50 +0200)
src/main.cpp

index ca3c3bc5d7025a373eb4bc5af621bcc25d2de3ee..dc67f29bb4b718c57ca200e8765871880d9de36d 100644 (file)
@@ -1266,7 +1266,11 @@ int main(int argc, char *argv[])
                        new_db->endSave();
 
                        actionstream << "Successfully migrated " << count << " blocks" << std::endl;
-                       actionstream << "Don't forget to update your world.mt backend setting!" << std::endl;
+                       world_mt.set("backend", migrate_to);
+                       if(!world_mt.updateConfigFile((world_path + DIR_DELIM + "world.mt").c_str()))
+                               errorstream<<"Failed to update world.mt!"<<std::endl;
+                       else
+                               actionstream<<"world.mt updated"<<std::endl;
 
                        return 0;
                }