Conditions: the Wintergrasp holder check no longer crashes away from Wintergrasp
condition_is_wintergrasp_horde and condition_is_wintergrasp_alliance used the battlefield of the condition's map without checking that there is one. Wintergrasp exists only on Northrend, and only while Wintergrasp.Enable is on, so a quest giver elsewhere whose quest carries this condition crashed the map every time a player came into view of it (the quest check for its speech bubble runs then). Eastern Kingdoms stopped updating near the Duskwood crossroads until the server went down. Reported by zeroyka.
This commit is contained in:
@@ -525,10 +525,10 @@ public:
|
||||
{
|
||||
if (!sourceInfo.mConditionMap)
|
||||
return false;
|
||||
// Wintergrasp exists only on Northrend, and only while Wintergrasp.Enable is on: anywhere else (a quest giver in Duskwood
|
||||
// whose quest carries this condition, a realm with the battle turned off) nobody holds it
|
||||
Battlefield* wintergrasp = sBattlefieldMgr->GetBattlefieldByBattleId(sourceInfo.mConditionMap, BATTLEFIELD_BATTLEID_WG);
|
||||
if (wintergrasp->IsEnabled() && wintergrasp->GetDefenderTeam() == TEAM_HORDE)
|
||||
return true;
|
||||
return false;
|
||||
return wintergrasp && wintergrasp->IsEnabled() && wintergrasp->GetDefenderTeam() == TEAM_HORDE;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -541,10 +541,10 @@ public:
|
||||
{
|
||||
if (!sourceInfo.mConditionMap)
|
||||
return false;
|
||||
// Wintergrasp exists only on Northrend, and only while Wintergrasp.Enable is on: anywhere else (a quest giver in Duskwood
|
||||
// whose quest carries this condition, a realm with the battle turned off) nobody holds it
|
||||
Battlefield* wintergrasp = sBattlefieldMgr->GetBattlefieldByBattleId(sourceInfo.mConditionMap, BATTLEFIELD_BATTLEID_WG);
|
||||
if (wintergrasp->IsEnabled() && wintergrasp->GetDefenderTeam() == TEAM_ALLIANCE)
|
||||
return true;
|
||||
return false;
|
||||
return wintergrasp && wintergrasp->IsEnabled() && wintergrasp->GetDefenderTeam() == TEAM_ALLIANCE;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user