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:
Karrz1
2026-11-15 08:26:52 +00:00
parent f29a849f27
commit 68adfcf3d0
@@ -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;
}
};