diff options
author | megamage <none@none> | 2008-12-01 17:36:11 -0600 |
---|---|---|
committer | megamage <none@none> | 2008-12-01 17:36:11 -0600 |
commit | 920dae4f7fbc0852035da5f12c42e24d70e45786 (patch) | |
tree | 55265fff9454ad494fdaa58aa992eb98ebc3fd37 /src/game/Player.cpp | |
parent | 28e1aec6df5ce68d9878794cd57f515261b1b782 (diff) |
*Fix the bug about arena personal rating.
*Update to Mangos 6870. Source: Mangos. Main change: add a function SaveDataFieldToDB().
--HG--
branch : trunk
Diffstat (limited to 'src/game/Player.cpp')
-rw-r--r-- | src/game/Player.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 783172a89d4..b00273b65c4 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -15395,7 +15395,8 @@ void Player::SaveToDB() void Player::SaveInventoryAndGoldToDB() { _SaveInventory(); - SetUInt32ValueInDB(PLAYER_FIELD_COINAGE,GetMoney(),GetGUID()); + //money is in data field + SaveDataFieldToDB(); } void Player::_SaveActions() @@ -15787,6 +15788,20 @@ void Player::SavePositionInDB(uint32 mapid, float x,float y,float z,float o,uint CharacterDatabase.Execute(ss.str().c_str()); } +void Player::SaveDataFieldToDB() +{ + std::ostringstream ss; + ss<<"UPDATE characters SET data='"; + + for(uint16 i = 0; i < m_valuesCount; i++ ) + { + ss << GetUInt32Value(i) << " "; + } + ss<<"' WHERE guid='"<< GUID_LOPART(GetGUIDLow()) <<"'"; + + CharacterDatabase.Execute(ss.str().c_str()); +} + bool Player::SaveValuesArrayInDB(Tokens const& tokens, uint64 guid) { std::ostringstream ss2; |