Core/Unit: Implement more helper methods
Port From (https://github.com/TrinityCore/TrinityCore/commit/104ec7a81a5bb782f81fd05b872bf664e4de1c89)
This commit is contained in:
@@ -535,13 +535,16 @@ namespace Game.Entities
|
||||
|
||||
//Powers
|
||||
public PowerType GetPowerType() { return (PowerType)(byte)m_unitData.DisplayPower; }
|
||||
public void SetPowerType(PowerType powerType)
|
||||
public void SetPowerType(PowerType powerType, bool sendUpdate = true)
|
||||
{
|
||||
if (GetPowerType() == powerType)
|
||||
return;
|
||||
|
||||
SetUpdateFieldValue(m_values.ModifyValue(m_unitData).ModifyValue(m_unitData.DisplayPower), (byte)powerType);
|
||||
|
||||
if (!sendUpdate)
|
||||
return;
|
||||
|
||||
Player thisPlayer = ToPlayer();
|
||||
if (thisPlayer != null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user