Core/Player: Instead of not saving eclipse power, set it to 0 on player load (shauren's idea, blame him =D)

Signed-off-by: Nay <[email protected]>
This commit is contained in:
Greymane
2012-08-16 23:19:47 +01:00
committed by Nay
parent f447403f6c
commit 00e81cd98a
+3 -11
View File
@@ -17157,6 +17157,8 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
for (; loadedPowers < MAX_STORED_POWERS; ++loadedPowers)
SetUInt32Value(UNIT_FIELD_POWER1 + loadedPowers, 0);
SetPower(POWER_ECLIPSE, 0);
// must be after loading spells and talents
Tokens talentTrees(fields[26].GetString(), ' ', MAX_TALENT_SPECS);
for (uint8 i = 0; i < MAX_TALENT_SPECS; ++i)
@@ -18657,12 +18659,7 @@ void Player::SaveToDB(bool create /*=false*/)
{
if (GetPowerIndexByClass(Powers(i), getClass()) != MAX_POWERS)
{
// Eclipse Power isnt saved.
if (i == POWER_ECLIPSE)
continue;
stmt->setUInt32(index++, GetUInt32Value(UNIT_FIELD_POWER1 + storedPowers));
if (++storedPowers >= MAX_STORED_POWERS)
break;
}
@@ -18784,12 +18781,7 @@ void Player::SaveToDB(bool create /*=false*/)
{
if (GetPowerIndexByClass(Powers(i), getClass()) != MAX_POWERS)
{
// Eclipse Power isnt saved.
if (i == POWER_ECLIPSE)
continue;
stmt->setUInt32(index++, GetUInt32Value(UNIT_FIELD_POWER1 + storedPowers));
stmt->setUInt32(index++, GetUInt32Value(UNIT_FIELD_POWER1 + storedPowers));
if (++storedPowers >= MAX_STORED_POWERS)
break;
}