mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-25 22:56:24 +00:00
refactor(Core/Entities): Cleanup Unit header file (#19622)
* move several enum definitions in a new files * move more things * remove the include comment * move the related code to CharmInfo in this own file *original idea of Ovahlord Co-Authored-By: Ovahlord <18347559+Ovahlord@users.noreply.github.com> * fix clang build errors and few blank lines * missing forward declaration * new tentative to fix gcc/clang build * add several include could be necessary for gcc/clang compilation * . * revert some include since the last AC update * fix some loop inconsistencies * align all enums in UnitDefine.h --------- Co-authored-by: Ovahlord <18347559+Ovahlord@users.noreply.github.com>
This commit is contained in:
@@ -290,6 +290,30 @@ private:
|
||||
|
||||
//=================================================
|
||||
|
||||
struct RedirectThreatInfo
|
||||
{
|
||||
RedirectThreatInfo() = default;
|
||||
ObjectGuid _targetGUID;
|
||||
uint32 _threatPct{ 0 };
|
||||
|
||||
[[nodiscard]] ObjectGuid GetTargetGUID() const { return _targetGUID; }
|
||||
[[nodiscard]] uint32 GetThreatPct() const { return _threatPct; }
|
||||
|
||||
void Set(ObjectGuid guid, uint32 pct)
|
||||
{
|
||||
_targetGUID = guid;
|
||||
_threatPct = pct;
|
||||
}
|
||||
|
||||
void ModifyThreatPct(int32 amount)
|
||||
{
|
||||
amount += _threatPct;
|
||||
_threatPct = uint32(std::max(0, amount));
|
||||
}
|
||||
};
|
||||
|
||||
//=================================================
|
||||
|
||||
namespace Acore
|
||||
{
|
||||
// Binary predicate for sorting HostileReferences based on threat value
|
||||
|
||||
Reference in New Issue
Block a user