Commit 5532faad authored by Chen Bill's avatar Chen Bill Committed by GitHub

update DataManager::LoadDB() (#2515)

parent e3155746
...@@ -53,6 +53,8 @@ bool DataManager::LoadDB(const wchar_t* wfile) { ...@@ -53,6 +53,8 @@ bool DataManager::LoadDB(const wchar_t* wfile) {
cd.code = sqlite3_column_int(pStmt, 0); cd.code = sqlite3_column_int(pStmt, 0);
cd.ot = sqlite3_column_int(pStmt, 1); cd.ot = sqlite3_column_int(pStmt, 1);
cd.alias = sqlite3_column_int(pStmt, 2); cd.alias = sqlite3_column_int(pStmt, 2);
auto setcode = sqlite3_column_int64(pStmt, 3);
if (setcode) {
auto it = extra_setcode.find(cd.code); auto it = extra_setcode.find(cd.code);
if (it != extra_setcode.end()) { if (it != extra_setcode.end()) {
int len = it->second.size(); int len = it->second.size();
...@@ -62,7 +64,8 @@ bool DataManager::LoadDB(const wchar_t* wfile) { ...@@ -62,7 +64,8 @@ bool DataManager::LoadDB(const wchar_t* wfile) {
memcpy(cd.setcode, it->second.data(), len * sizeof(uint16_t)); memcpy(cd.setcode, it->second.data(), len * sizeof(uint16_t));
} }
else else
cd.set_setcode(sqlite3_column_int64(pStmt, 3)); cd.set_setcode(setcode);
}
cd.type = sqlite3_column_int(pStmt, 4); cd.type = sqlite3_column_int(pStmt, 4);
cd.attack = sqlite3_column_int(pStmt, 5); cd.attack = sqlite3_column_int(pStmt, 5);
cd.defense = sqlite3_column_int(pStmt, 6); cd.defense = sqlite3_column_int(pStmt, 6);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment