Steps to reproduce the problem:
Also happens in Arena
Related issue: #20616
Branch(es): 3.3.5
TC rev. hash/commit: 9f943e284f2418e8e90d1bcf5d0a5fbf073580f3
TDB version: TDB335.63
Operating system: Debian
It's good anticheat measure :trollface:
Problem is order from the calls in bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *holder)
:
First we call map->ToBattlegroundMap()->GetBG()->AddPlayer(this);
this will apply Preparation aura in player, which will modify UNIT_FIELD_POWER_COST_MULTIPLIER to -1.
Then we call InitStatsForLevel();
which will reset UNIT_FIELD_POWER_COST_MULTIPLIER to 0.
And then, when the Bg starts, Preparation aura is removed and will increase the amount, not expecting that it was set to 0, causing double costs.
I have no idea on how to fix, just changing the order of the calls could break other things, or not..
Mby @Shauren can point to right direction how this could be fixed?
InitStatsForLevel
probably shouldn't clear UNIT_FIELD_POWER_COST_MULTIPLIER
What about calling InitStatsForLevel before actually loading auras?
Most helpful comment
Problem is order from the calls in
bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *holder)
:First we call
map->ToBattlegroundMap()->GetBG()->AddPlayer(this);
this will apply Preparation aura in player, which will modify UNIT_FIELD_POWER_COST_MULTIPLIER to -1.Then we call
InitStatsForLevel();
which will reset UNIT_FIELD_POWER_COST_MULTIPLIER to 0.And then, when the Bg starts, Preparation aura is removed and will increase the amount, not expecting that it was set to 0, causing double costs.
I have no idea on how to fix, just changing the order of the calls could break other things, or not..