mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
[9232] Replace list bool fields with exclusive true values by subtype field in Creature.
Use it in recently added code instead dynamic_cast use.
This commit is contained in:
parent
6653539a5e
commit
797dd6d931
9 changed files with 29 additions and 21 deletions
|
|
@ -94,11 +94,12 @@ void PointMovementGenerator<Creature>::MovementInform(Creature &unit)
|
|||
if (unit.AI())
|
||||
unit.AI()->MovementInform(POINT_MOTION_TYPE, id);
|
||||
|
||||
if (TemporarySummon* pSummon = dynamic_cast<TemporarySummon*>(&unit))
|
||||
if (unit.isTemporarySummon())
|
||||
{
|
||||
if (Unit* pSummoner = pSummon->GetSummoner())
|
||||
TemporarySummon* pSummon = (TemporarySummon*)(&unit);
|
||||
if (IS_CREATURE_GUID(pSummon->GetSummonerGUID()))
|
||||
{
|
||||
if (pSummoner->GetTypeId() == TYPEID_UNIT)
|
||||
if (Unit* pSummoner = pSummon->GetSummoner())
|
||||
{
|
||||
if (((Creature*)pSummoner)->AI())
|
||||
((Creature*)pSummoner)->AI()->SummonedMovementInform(&unit, POINT_MOTION_TYPE, id);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue