Trinitycore: [3.3.5] Core/Battleground: Getting double power cost

Created on 23 Oct 2017  路  5Comments  路  Source: TrinityCore/TrinityCore

Steps to reproduce the problem:

  1. You need use 3 characters, 2 of the same faction, 1 opposition faction
  2. Put 2 characters in Party and join some bg (using join as party button) (.debug bg can help you), after join with oher faction character
  3. In preparation time, see power cost of spells and force 1 of character (in party) disconect (like trying login again).
  4. Login back this character and see the power cost.
  5. When Preparation Time end and you use spells you lose double power cost

Also happens in Arena

Related issue: #20616

Branch(es): 3.3.5

TC rev. hash/commit: 9f943e284f2418e8e90d1bcf5d0a5fbf073580f3

TDB version: TDB335.63

Operating system: Debian

Branch-3.3.5a Comp-Core Sub-PvP-Zones Sub-Spells

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..

All 5 comments

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?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Rochet2 picture Rochet2  路  3Comments

Lopfest picture Lopfest  路  3Comments

DDuarte picture DDuarte  路  3Comments

chilito picture chilito  路  3Comments

Rushor picture Rushor  路  3Comments