aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMachiavelli <none@none>2009-08-22 13:43:50 +0200
committerMachiavelli <none@none>2009-08-22 13:43:50 +0200
commit6ac8fcf4890f667b87ea7c26e606c551eb688c9e (patch)
treec379f5f0222462db22088e35d1ea71524af34858 /src
parentb25945b247a40b8c588ac9987aa13a0000f03781 (diff)
* Use DB transaction in Player::_SaveGlyphs()
* Remove not needed query in Player::UpdateSpecCount --HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/Player.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index 2a069b99517..5afe15664e8 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -21754,12 +21754,14 @@ void Player::_LoadGlyphs(QueryResult *result)
void Player::_SaveGlyphs()
{
+ CharacterDatabase.BeginTransaction();
CharacterDatabase.PExecute("DELETE FROM character_glyphs WHERE guid='%u'",GetGUIDLow());
for (uint8 spec = 0; spec < m_specsCount; ++spec)
{
CharacterDatabase.PExecute("INSERT INTO character_glyphs VALUES('%u', '%u', '%u', '%u', '%u', '%u', '%u', '%u')",
GetGUIDLow(), spec, m_Glyphs[spec][0], m_Glyphs[spec][1], m_Glyphs[spec][2], m_Glyphs[spec][3], m_Glyphs[spec][4], m_Glyphs[spec][5]);
}
+ CharacterDatabase.CommitTransaction();
}
void Player::_LoadTalents(QueryResult *result)
@@ -21815,7 +21817,6 @@ void Player::UpdateSpecCount(uint8 count)
_SaveActions(); // make sure the button list is cleaned up
// active spec becomes only spec?
CharacterDatabase.PExecute("DELETE FROM character_action WHERE spec<>'%u' AND guid='%u'",m_activeSpec, GetGUIDLow());
- CharacterDatabase.PExecute("UPDATE character_action SET spec='0' WHERE guid='%u'", GetGUIDLow());
m_activeSpec = 0;
}
else if (count == MAX_TALENT_SPECS)