From ce8cc85dfabeb57c30f2f2e6deb577abeaabaf37 Mon Sep 17 00:00:00 2001 From: Anubisss Date: Sat, 27 Mar 2010 16:08:14 +0100 Subject: Make a function(ToTempSummon()) which can convert Creature to TempSummon with a C++ cast(reinterpret_cast) and with a type check(isSummon()). This function is like ToPlayer(), ToTotem(), etc. This commit is like ede831bdd6f0cff481acc33f269fa7f8c78befd4 / r7496: http://code.google.com/p/trinitycore/source/detail?r=ede831bdd6f0cff481acc33f269fa7f8c78befd4 As a result, this commit has the advantages and the "disadvantages" too, like r7496. Please try to be polite if this commit causes some crashes. --HG-- branch : trunk --- src/game/TemporarySummon.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/game/TemporarySummon.cpp') diff --git a/src/game/TemporarySummon.cpp b/src/game/TemporarySummon.cpp index e708aadfd77..c60e0119821 100644 --- a/src/game/TemporarySummon.cpp +++ b/src/game/TemporarySummon.cpp @@ -197,7 +197,7 @@ void TempSummon::InitStats(uint32 duration) { Creature *oldSummon = GetMap()->GetCreature(owner->m_SummonSlot[slot]); if(oldSummon && oldSummon->isSummon()) - ((TempSummon*)oldSummon)->UnSummon(); + oldSummon->ToTempSummon()->UnSummon(); } owner->m_SummonSlot[slot] = GetGUID(); } -- cgit v1.2.3