*Use map pointer of killed creature instead of player pointer to prevent crash in case killer is not in world.

--HG--
branch : trunk
This commit is contained in:
QAston
2009-07-20 16:59:15 +02:00
parent ffcbd11b2c
commit b1183c931b
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -117,7 +117,7 @@ namespace Trinity
(((Creature*)u)->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_XP_AT_KILL) ))
return 0;
uint32 xp_gain= BaseGain(pl->getLevel(), u->getLevel(), GetContentLevelsForMapAndZone(pl->GetMapId(),pl->GetZoneId()));
uint32 xp_gain= BaseGain(pl->getLevel(), u->getLevel(), GetContentLevelsForMapAndZone(u->GetMapId(),u->GetZoneId()));
if( xp_gain == 0 )
return 0;
+1
View File
@@ -13668,6 +13668,7 @@ void Unit::SetToNotify()
void Unit::Kill(Unit *pVictim, bool durabilityLoss)
{
assert(pVictim->IsInWorld() && pVictim->FindMap());
// Prevent killing unit twice (and giving reward from kill twice)
if (!pVictim->GetHealth())
return;