Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make it compile
  • Loading branch information
sfan5 committed Sep 9, 2013
1 parent 58841ef commit 7e44c2a
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/database-dummy.cpp
Expand Up @@ -47,7 +47,7 @@ void Database_Dummy::saveBlock(MapBlock *block)
}

// Format used for writing
u8 version = SER_FMT_VER_HIGHEST;
u8 version = SER_FMT_VER_HIGHEST_WRITE;
// Get destination
v3s16 p3d = block->getPos();

Expand Down
2 changes: 1 addition & 1 deletion src/database-leveldb.cpp
Expand Up @@ -55,7 +55,7 @@ void Database_LevelDB::saveBlock(MapBlock *block)
}

// Format used for writing
u8 version = SER_FMT_VER_HIGHEST;
u8 version = SER_FMT_VER_HIGHEST_WRITE;
// Get destination
v3s16 p3d = block->getPos();

Expand Down
2 changes: 1 addition & 1 deletion src/database-sqlite3.cpp
Expand Up @@ -135,7 +135,7 @@ void Database_SQLite3::saveBlock(MapBlock *block)
}

// Format used for writing
u8 version = SER_FMT_VER_HIGHEST;
u8 version = SER_FMT_VER_HIGHEST_WRITE;
// Get destination
v3s16 p3d = block->getPos();

Expand Down
2 changes: 2 additions & 0 deletions src/database.h
Expand Up @@ -7,6 +7,8 @@
#include "mapblock.h"
#include "main.h"
#include "filesys.h"
#include "serialization.h"
#include <irrList.h>

class Database;
class ServerMap;
Expand Down
8 changes: 4 additions & 4 deletions src/main.cpp
Expand Up @@ -795,8 +795,8 @@ int main(int argc, char *argv[])
allowed_options.insert(std::make_pair("gameid", ValueSpec(VALUETYPE_STRING,
_("Set gameid (\"--gameid list\" prints available ones)"))));
#if USE_LEVELDB
allowed_options.insert("migrate", ValueSpec(VALUETYPE_STRING,
_("Migrate from current map backend to another")));
allowed_options.insert(std::make_pair("migrate", ValueSpec(VALUETYPE_STRING,
_("Migrate from current map backend to another"))));
#endif
#ifndef SERVER
allowed_options.insert(std::make_pair("videomodes", ValueSpec(VALUETYPE_FLAG,
Expand Down Expand Up @@ -1248,12 +1248,12 @@ int main(int argc, char *argv[])
return 1;
}

core::list<v3s16> blocks;
std::list<v3s16> blocks;
ServerMap &old_map = ((ServerMap&)server.getMap());
old_map.listAllLoadableBlocks(blocks);
int count = 0;
new_db->beginSave();
for (core::list<v3s16>::Iterator i = blocks.begin(); i != blocks.end(); ++i) {
for (std::list<v3s16>::iterator i = blocks.begin(); i != blocks.end(); ++i) {
MapBlock *block = old_map.loadBlock(*i);
new_db->saveBlock(block);
MapSector *sector = old_map.getSectorNoGenerate(v2s16(i->X, i->Z));
Expand Down
5 changes: 4 additions & 1 deletion src/map.cpp
Expand Up @@ -3371,7 +3371,10 @@ void ServerMap::listAllLoadableBlocks(std::list<v3s16> &dst)
errorstream<<"Map::listAllLoadableBlocks(): Result will be missing "
<<"all blocks that are stored in flat files"<<std::endl;
}
dbase->listAllLoadableBlocks(dst);
core::list<v3s16> dst_;
dbase->listAllLoadableBlocks(dst_);
for(core::list<v3s16>::Iterator i = dst_.begin(); i != dst_.end(); ++i)
dst.push_back(*i);
}

void ServerMap::listAllLoadedBlocks(std::list<v3s16> &dst)
Expand Down
1 change: 1 addition & 0 deletions src/server.h
Expand Up @@ -32,6 +32,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "rollback_interface.h" // Needed for rollbackRevertActions()
#include "util/numeric.h"
#include "util/thread.h"
#include "environment.h"
#include <string>
#include <list>
#include <map>
Expand Down

0 comments on commit 7e44c2a

Please sign in to comment.