diff options
author | tartalo <none@none> | 2009-11-11 13:45:10 +0100 |
---|---|---|
committer | tartalo <none@none> | 2009-11-11 13:45:10 +0100 |
commit | 558e334c3379216d053c18c08b05971587f8f8d2 (patch) | |
tree | d35d682d950eefd3f8fc7bdbdb6b55e010a85d0e /src | |
parent | bbe7de48b85ef0e82c7ad67cc88fbab468f2fb48 (diff) |
Wintergrasp: Fix tenacity calculation, by rammbonr5. Closes #156
Wintergrasp: Safe check to avoid crash, by Spp. Closes #188
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/game/Wintergrasp.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/game/Wintergrasp.cpp b/src/game/Wintergrasp.cpp index 37c70c87271..5a3157028e3 100644 --- a/src/game/Wintergrasp.cpp +++ b/src/game/Wintergrasp.cpp @@ -977,8 +977,11 @@ bool OPvPWintergrasp::UpdateQuestGiverPosition(uint32 guid, Creature *creature) creature->GetPositionZ() == pos.GetPositionZ()) return false; - creature->CombatStop(true); - creature->getHostilRefManager().deleteReferences(); + if (creature->isInCombat()) + { + creature->CombatStop(true); + creature->getHostilRefManager().deleteReferences(); + } creature->SetHomePosition(pos); creature->DestroyForNearbyPlayers(); if (!creature->GetMap()->IsLoaded(pos.GetPositionX(), pos.GetPositionY())) @@ -1252,9 +1255,9 @@ void OPvPWintergrasp::UpdateTenacityStack() 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) - 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) |