Entities/Player: Properly restore PvP-enabled state on login

Port From (https://github.com/TrinityCore/TrinityCore/commit/a5d8807af8cb0f257f81fa5cf3ac70769b677575)
This commit is contained in:
hondacrx
2021-12-27 16:33:10 -05:00
parent 828fafbcc8
commit 8e06e237e0
3 changed files with 28 additions and 14 deletions
+5 -4
View File
@@ -3056,11 +3056,10 @@ namespace Game.Entities
// set value, including drunk invisibility detection
// calculate sobering. after 15 minutes logged out, the player will be sober again
byte newDrunkValue = 0;
if (time_diff < (uint)GetDrunkValue() * 9)
newDrunkValue = (byte)(GetDrunkValue() - time_diff / 9);
SetDrunkValue(newDrunkValue);
SetDrunkValue((byte)(GetDrunkValue() - time_diff / 9));
else
SetDrunkValue(0);
m_createTime = createTime;
m_createMode = createMode;
@@ -3297,6 +3296,8 @@ namespace Game.Entities
}
}
InitPvP();
// RaF stuff.
if (GetSession().IsARecruiter() || (GetSession().GetRecruiterId() != 0))
AddDynamicFlag(UnitDynFlags.ReferAFriend);