aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2016-06-21 20:45:34 +0200
committerShauren <shauren.trinity@gmail.com>2016-06-21 20:45:34 +0200
commit9a2d8eac99a0600387201bd40efc6b6e30dbfd03 (patch)
tree446455fe736b9c757f0681d906faba6fc3af030f
parentf6cac4df5b2765ac0bf710da36dc28c83cd119ed (diff)
Prepared statement parameter fix, screw manual indexing
-rw-r--r--src/server/game/Entities/Item/Item.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp
index a3193bd3de3..47e711c33cd 100644
--- a/src/server/game/Entities/Item/Item.cpp
+++ b/src/server/game/Entities/Item/Item.cpp
@@ -518,12 +518,13 @@ bool Item::LoadFromDB(ObjectGuid::LowType guid, ObjectGuid ownerGuid, Field* fie
if (need_save) // normal item changed state set not work at loading
{
+ uint8 index = 0;
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ITEM_INSTANCE_ON_LOAD);
- stmt->setUInt32(0, GetUInt32Value(ITEM_FIELD_DURATION));
- stmt->setUInt32(1, GetUInt32Value(ITEM_FIELD_FLAGS));
- stmt->setUInt32(2, GetUInt32Value(ITEM_FIELD_DURABILITY));
- stmt->setUInt32(3, GetModifier(ITEM_MODIFIER_UPGRADE_ID));
- stmt->setUInt64(3, guid);
+ stmt->setUInt32(index++, GetUInt32Value(ITEM_FIELD_DURATION));
+ stmt->setUInt32(index++, GetUInt32Value(ITEM_FIELD_FLAGS));
+ stmt->setUInt32(index++, GetUInt32Value(ITEM_FIELD_DURABILITY));
+ stmt->setUInt32(index++, GetModifier(ITEM_MODIFIER_UPGRADE_ID));
+ stmt->setUInt64(index++, guid);
CharacterDatabase.Execute(stmt);
}