summaryrefslogtreecommitdiffstats
path: root/src/account-server
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2011-04-13 23:55:44 +0200
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2011-04-13 23:59:23 +0200
commit89944ee6755a8d1cf1afb8e1e4808529bccf04c6 (patch)
treec4b819f7f3f09bbcfd0eb35d956bed650704b610 /src/account-server
parent148f7bcf39900074a6d5fbd7004834cb994436e2 (diff)
downloadmanaserv-89944ee6755a8d1cf1afb8e1e4808529bccf04c6.tar.gz
manaserv-89944ee6755a8d1cf1afb8e1e4808529bccf04c6.tar.xz
manaserv-89944ee6755a8d1cf1afb8e1e4808529bccf04c6.zip
Fixed swapping of equipment and inventory slots
This was happening when retrieving characters from the database. Also made the query more explicit about which columns it requests. Reviewed-by: Yohann Ferreira
Diffstat (limited to 'src/account-server')
-rw-r--r--src/account-server/storage.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/account-server/storage.cpp b/src/account-server/storage.cpp
index 766864b..b17a4c2 100644
--- a/src/account-server/storage.cpp
+++ b/src/account-server/storage.cpp
@@ -490,7 +490,8 @@ Character *Storage::getCharacterBySQL(Account *owner)
try
{
std::ostringstream sql;
- sql << " select * from " << CHAR_EQUIPS_TBL_NAME
+ sql << " select slot_type, inventory_slot from "
+ << CHAR_EQUIPS_TBL_NAME
<< " where owner_id = '"
<< character->getDatabaseID() << "' order by slot_type desc;";
@@ -498,8 +499,8 @@ Character *Storage::getCharacterBySQL(Account *owner)
if (!equipInfo.isEmpty())
for (int k = 0, size = equipInfo.rows(); k < size; ++k)
poss.equipSlots.insert(std::pair<unsigned int, unsigned int>(
- toUint(equipInfo(k, 3)),
- toUint(equipInfo(k, 2))));
+ toUint(equipInfo(k, 0)),
+ toUint(equipInfo(k, 1))));
}
catch (const dal::DbSqlQueryExecFailure &e)
{