aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormaximius <none@none>2009-11-17 21:23:15 -0800
committermaximius <none@none>2009-11-17 21:23:15 -0800
commit4eb608b4785a15d1f98d04b8a78f45d424a6f4af (patch)
tree939d117a168d6c148e4734f1dd2b1dae8707fafc /src
parent929df85572f8f05751cbdf36d1c463fbd829d49d (diff)
*Should fix some Wintersgrasp crashes, some code by Spp. Refs #262
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/Wintergrasp.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/game/Wintergrasp.cpp b/src/game/Wintergrasp.cpp
index 4c42cea5e01..a1e8b4a0a50 100644
--- a/src/game/Wintergrasp.cpp
+++ b/src/game/Wintergrasp.cpp
@@ -964,11 +964,11 @@ bool OPvPWintergrasp::UpdateCreatureInfo(Creature *creature)
bool OPvPWintergrasp::UpdateQuestGiverPosition(uint32 guid, Creature *creature)
{
+ assert(guid);
Position pos = m_qgPosMap[std::pair<uint32, bool>(guid, getDefenderTeam() == TEAM_HORDE)];
- if (!pos.GetPositionX())
- return false;
+ assert(pos);
- if (creature)
+ if (creature && creature->IsInWorld())
{
// if not questgiver or position is the same, do nothing
if (creature->GetPositionX() == pos.GetPositionX() &&
@@ -976,7 +976,7 @@ bool OPvPWintergrasp::UpdateQuestGiverPosition(uint32 guid, Creature *creature)
creature->GetPositionZ() == pos.GetPositionZ())
return false;
- if (creature->isInCombat())
+ if (creature->isAlive() && creature->isInCombat())
{
creature->CombatStop(true);
creature->getHostilRefManager().deleteReferences();
@@ -990,9 +990,8 @@ bool OPvPWintergrasp::UpdateQuestGiverPosition(uint32 guid, Creature *creature)
creature->Respawn(true);
}
else
- {
objmgr.MoveCreData(guid, 571, pos);
- }
+
return true;
}