mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-26 15:16:24 +00:00
Fix corrupt item cache crashes, bot whispers, trade crashes
This commit is contained in:
@@ -287,6 +287,18 @@ protected:
|
||||
uint32 BasesDefended = 0;
|
||||
};
|
||||
|
||||
struct CaptureABPointInfo
|
||||
{
|
||||
CaptureABPointInfo() : _ownerTeamId(TEAM_NEUTRAL), _iconNone(0), _iconCapture(0), _state(BG_AB_NODE_STATE_NEUTRAL), _captured(false) {}
|
||||
|
||||
TeamId _ownerTeamId;
|
||||
uint32 _iconNone;
|
||||
uint32 _iconCapture;
|
||||
uint8 _state;
|
||||
|
||||
bool _captured;
|
||||
};
|
||||
|
||||
class AC_GAME_API BattlegroundAB : public Battleground
|
||||
{
|
||||
public:
|
||||
@@ -311,6 +323,9 @@ public:
|
||||
bool IsTeamScores500Disadvantage(TeamId teamId) const { return _teamScores500Disadvantage[teamId]; }
|
||||
|
||||
TeamId GetPrematureWinner() override;
|
||||
|
||||
[[nodiscard]] CaptureABPointInfo const& GetCapturePointInfo(uint32 node) const { return _capturePointInfo[node]; }
|
||||
|
||||
private:
|
||||
void PostUpdateImpl(uint32 diff) override;
|
||||
|
||||
@@ -321,21 +336,7 @@ private:
|
||||
void NodeDeoccupied(uint8 node);
|
||||
void ApplyPhaseMask();
|
||||
|
||||
struct CapturePointInfo
|
||||
{
|
||||
CapturePointInfo() : _ownerTeamId(TEAM_NEUTRAL), _iconNone(0), _iconCapture(0), _state(BG_AB_NODE_STATE_NEUTRAL), _captured(false)
|
||||
{
|
||||
}
|
||||
|
||||
TeamId _ownerTeamId;
|
||||
uint32 _iconNone;
|
||||
uint32 _iconCapture;
|
||||
uint8 _state;
|
||||
|
||||
bool _captured;
|
||||
};
|
||||
|
||||
CapturePointInfo _capturePointInfo[BG_AB_DYNAMIC_NODES_COUNT];
|
||||
CaptureABPointInfo _capturePointInfo[BG_AB_DYNAMIC_NODES_COUNT];
|
||||
EventMap _bgEvents;
|
||||
uint32 _honorTics;
|
||||
uint32 _reputationTics;
|
||||
|
||||
@@ -376,6 +376,25 @@ protected:
|
||||
uint32 FlagCaptures = 0;
|
||||
};
|
||||
|
||||
struct CaptureEYPointInfo
|
||||
{
|
||||
CaptureEYPointInfo() : _ownerTeamId(TEAM_NEUTRAL), _barStatus(BG_EY_PROGRESS_BAR_STATE_MIDDLE), _areaTrigger(0)
|
||||
{
|
||||
_playersCount[TEAM_ALLIANCE] = 0;
|
||||
_playersCount[TEAM_HORDE] = 0;
|
||||
}
|
||||
|
||||
Player* player = nullptr;
|
||||
TeamId _ownerTeamId;
|
||||
int8 _barStatus;
|
||||
uint32 _areaTrigger;
|
||||
int8 _playersCount[PVP_TEAMS_COUNT];
|
||||
|
||||
bool IsUnderControl(TeamId teamId) const { return _ownerTeamId == teamId; }
|
||||
bool IsUnderControl() const { return _ownerTeamId != TEAM_NEUTRAL; }
|
||||
bool IsUncontrolled() const { return _ownerTeamId == TEAM_NEUTRAL; }
|
||||
};
|
||||
|
||||
class AC_GAME_API BattlegroundEY : public Battleground
|
||||
{
|
||||
public:
|
||||
@@ -415,6 +434,8 @@ public:
|
||||
bool AllNodesConrolledByTeam(TeamId teamId) const override;
|
||||
TeamId GetPrematureWinner() override;
|
||||
|
||||
[[nodiscard]] CaptureEYPointInfo const& GetCapturePointInfo(uint32 node) const { return _capturePointInfo[node]; }
|
||||
|
||||
private:
|
||||
void PostUpdateImpl(uint32 diff) override;
|
||||
|
||||
@@ -430,26 +451,7 @@ private:
|
||||
/* Scorekeeping */
|
||||
void AddPoints(TeamId teamId, uint32 points);
|
||||
|
||||
struct CapturePointInfo
|
||||
{
|
||||
CapturePointInfo() : _ownerTeamId(TEAM_NEUTRAL), _barStatus(BG_EY_PROGRESS_BAR_STATE_MIDDLE), _areaTrigger(0)
|
||||
{
|
||||
_playersCount[TEAM_ALLIANCE] = 0;
|
||||
_playersCount[TEAM_HORDE] = 0;
|
||||
}
|
||||
|
||||
TeamId _ownerTeamId;
|
||||
int8 _barStatus;
|
||||
uint32 _areaTrigger;
|
||||
int8 _playersCount[PVP_TEAMS_COUNT];
|
||||
Player* player = nullptr;
|
||||
|
||||
bool IsUnderControl(TeamId teamId) const { return _ownerTeamId == teamId; }
|
||||
bool IsUnderControl() const { return _ownerTeamId != TEAM_NEUTRAL; }
|
||||
bool IsUncontrolled() const { return _ownerTeamId == TEAM_NEUTRAL; }
|
||||
};
|
||||
|
||||
CapturePointInfo _capturePointInfo[EY_POINTS_MAX];
|
||||
CaptureEYPointInfo _capturePointInfo[EY_POINTS_MAX];
|
||||
EventMap _bgEvents;
|
||||
uint32 _honorTics;
|
||||
uint8 _ownedPointsCount[PVP_TEAMS_COUNT];
|
||||
|
||||
@@ -983,6 +983,9 @@ public:
|
||||
bool AllNodesConrolledByTeam(TeamId teamId) const override; // overwrited
|
||||
bool IsResourceGlutAllowed(TeamId teamId) const;
|
||||
void DoAction(uint32 action, ObjectGuid guid) override;
|
||||
|
||||
[[nodiscard]] ICNodePoint const& GetICNodePoint(uint8 index) { return nodePoint[index]; }
|
||||
|
||||
private:
|
||||
uint32 closeFortressDoorsTimer;
|
||||
bool doorsClosed;
|
||||
|
||||
Reference in New Issue
Block a user