Wintergrasp: Fix tenacity calculation, by rammbonr5. Closes #156
Wintergrasp: Safe check to avoid crash, by Spp. Closes #188 --HG-- branch : trunk
This commit is contained in:
@@ -977,8 +977,11 @@ bool OPvPWintergrasp::UpdateQuestGiverPosition(uint32 guid, Creature *creature)
|
|||||||
creature->GetPositionZ() == pos.GetPositionZ())
|
creature->GetPositionZ() == pos.GetPositionZ())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
creature->CombatStop(true);
|
if (creature->isInCombat())
|
||||||
creature->getHostilRefManager().deleteReferences();
|
{
|
||||||
|
creature->CombatStop(true);
|
||||||
|
creature->getHostilRefManager().deleteReferences();
|
||||||
|
}
|
||||||
creature->SetHomePosition(pos);
|
creature->SetHomePosition(pos);
|
||||||
creature->DestroyForNearbyPlayers();
|
creature->DestroyForNearbyPlayers();
|
||||||
if (!creature->GetMap()->IsLoaded(pos.GetPositionX(), pos.GetPositionY()))
|
if (!creature->GetMap()->IsLoaded(pos.GetPositionX(), pos.GetPositionY()))
|
||||||
@@ -1252,9 +1255,9 @@ void OPvPWintergrasp::UpdateTenacityStack()
|
|||||||
if (allianceNum && hordeNum)
|
if (allianceNum && hordeNum)
|
||||||
{
|
{
|
||||||
if (allianceNum < hordeNum)
|
if (allianceNum < hordeNum)
|
||||||
newStack = (hordeNum / allianceNum - 1)*4; // positive, should cast on alliance
|
newStack = int32((hordeNum / (float)allianceNum - 1)*4); // positive, should cast on alliance
|
||||||
else if (allianceNum > hordeNum)
|
else if (allianceNum > hordeNum)
|
||||||
newStack = (1 - int32(allianceNum / hordeNum))*4; // negative, should cast on horde
|
newStack = int32((1 - allianceNum / (float)hordeNum)*4); // negative, should cast on horde
|
||||||
}
|
}
|
||||||
|
|
||||||
if (newStack == m_tenacityStack)
|
if (newStack == m_tenacityStack)
|
||||||
|
|||||||
Reference in New Issue
Block a user