Core/Misc: Fix a crash in CalendarMgr::AddAction and initialize some wild pointers.

This commit is contained in:
kaelima committed 2012-03-02 12:23:16 +01:00
1 parent 254256668b
commit 394dbf0cdc
3 files changed
+20 -26

No files matched your search

+2 -13
View File
@@ -784,20 +784,9 @@ uint32 Unit::DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDam
// last damage from duel opponent
if (duel_hasEnded)
{
Player* he;
Player* he = duel_wasMounted ? victim->GetCharmer()->ToPlayer() : victim->ToPlayer();
if (duel_wasMounted)
{
ASSERT(victim->GetCharmer()->GetTypeId() == TYPEID_PLAYER);
he = victim->GetCharmer()->ToPlayer();
}
else
{
ASSERT(victim->GetTypeId() == TYPEID_PLAYER);
he = victim->ToPlayer();
}
ASSERT(he->duel);
ASSERT(he && he->duel);
if (duel_wasMounted) // In this case victim==mount
victim->SetHealth(1);