summaryrefslogtreecommitdiff
path: root/src/account-server/storage.cpp
diff options
context:
space:
mode:
authorFreeyorp <Freeyorp101@hotmail.com>2010-08-14 13:25:09 +1200
committerFreeyorp <Freeyorp101@hotmail.com>2010-08-14 13:31:14 +1200
commita822f8f257aaec37174a11add3543ef70a29e206 (patch)
tree8d4c08fc9eba48b79edf7cba8765652cca7bdee2 /src/account-server/storage.cpp
parent042496563e38f7a55306f2c32634880802c79f5b (diff)
downloadmanaserv-a822f8f257aaec37174a11add3543ef70a29e206.tar.gz
manaserv-a822f8f257aaec37174a11add3543ef70a29e206.tar.bz2
manaserv-a822f8f257aaec37174a11add3543ef70a29e206.tar.xz
manaserv-a822f8f257aaec37174a11add3543ef70a29e206.zip
Set the database ID of a new character immediately after creating it.
(Ooops.)
Diffstat (limited to 'src/account-server/storage.cpp')
-rw-r--r--src/account-server/storage.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/account-server/storage.cpp b/src/account-server/storage.cpp
index f427a2a7..e740b103 100644
--- a/src/account-server/storage.cpp
+++ b/src/account-server/storage.cpp
@@ -1048,6 +1048,9 @@ void Storage::flush(Account *account)
mDb->execSql(sqlInsertCharactersTable.str());
+ // Update the character ID.
+ (*it)->setDatabaseID(mDb->getLastId());
+
// Update all attributes.
std::map<unsigned int, std::pair<double, double> >::const_iterator
attr_it, attr_end;
@@ -1059,9 +1062,6 @@ void Storage::flush(Account *account)
attr_it->second.first,
attr_it->second.second);
- // Update the character ID.
- (*it)->setDatabaseID(mDb->getLastId());
-
// update the characters skill
std::map<int, int>::const_iterator skill_it;
for (skill_it = (*it)->mExperience.begin();