diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2011-03-13 23:36:26 +0100 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2011-03-15 22:53:44 +0100 |
commit | 36176429650f0b7264b2f240c21175ca29dee749 (patch) | |
tree | 0a018727c985dbd59d4a7f6042d737a3ef533107 /src/account-server/storage.cpp | |
parent | 3a31f9139a8ac4c74113392c76599873c18cea62 (diff) | |
download | manaserv-36176429650f0b7264b2f240c21175ca29dee749.tar.gz manaserv-36176429650f0b7264b2f240c21175ca29dee749.tar.bz2 manaserv-36176429650f0b7264b2f240c21175ca29dee749.tar.xz manaserv-36176429650f0b7264b2f240c21175ca29dee749.zip |
Introduced an AttributeValue class for convenience and readability
Easier to understand than a std::pair with its 'first' and 'second'
members, and it also provides an implicit constructor so that
AttributeValue is implicitly constructed from a double.
Reviewed-by: Freeyorp
Diffstat (limited to 'src/account-server/storage.cpp')
-rw-r--r-- | src/account-server/storage.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/account-server/storage.cpp b/src/account-server/storage.cpp index 50b131b7..9d293a37 100644 --- a/src/account-server/storage.cpp +++ b/src/account-server/storage.cpp @@ -693,11 +693,10 @@ bool Storage::updateCharacter(Character *character) // Character attributes. try { - std::ostringstream sqlAttr; for (AttributeMap::const_iterator it = character->mAttributes.begin(), it_end = character->mAttributes.end(); it != it_end; ++it) updateAttribute(character->getDatabaseID(), it->first, - it->second.first, it->second.second); + it->second.base, it->second.modified); } catch (const dal::DbSqlQueryExecFailure &e) { @@ -998,8 +997,8 @@ void Storage::flush(Account *account) attr_it != attr_end; ++attr_it) { updateAttribute(character->getDatabaseID(), attr_it->first, - attr_it->second.first, - attr_it->second.second); + attr_it->second.base, + attr_it->second.modified); } // Update the characters skill |