mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-26 20:02:25 +01:00
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
This commit is contained in:
@@ -57,7 +57,7 @@ void CreatureAI::DoZoneInCombat(Creature* creature)
|
||||
creature->AI()->AttackStart(target);
|
||||
else if(creature->isSummon())
|
||||
{
|
||||
if(Unit *summoner = ((TempSummon*)creature)->GetSummoner())
|
||||
if(Unit *summoner = creature->ToTempSummon()->GetSummoner())
|
||||
{
|
||||
Unit *target = summoner->getAttackerForHelper();
|
||||
if(!target && summoner->CanHaveThreatList() && !summoner->getThreatManager().isThreatListEmpty())
|
||||
|
||||
Reference in New Issue
Block a user