mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[9229] Add AI function SummonedMovementInform
Informing summoner of summoned when it reach a movement point (MovePoint)
This commit is contained in:
parent
4178d5bb6a
commit
0ed769c828
3 changed files with 19 additions and 2 deletions
|
|
@ -20,6 +20,7 @@
|
|||
#include "Errors.h"
|
||||
#include "Creature.h"
|
||||
#include "CreatureAI.h"
|
||||
#include "TemporarySummon.h"
|
||||
#include "DestinationHolderImp.h"
|
||||
#include "World.h"
|
||||
|
||||
|
|
@ -90,7 +91,20 @@ void PointMovementGenerator<Player>::MovementInform(Player&)
|
|||
template <>
|
||||
void PointMovementGenerator<Creature>::MovementInform(Creature &unit)
|
||||
{
|
||||
unit.AI()->MovementInform(POINT_MOTION_TYPE, id);
|
||||
if (unit.AI())
|
||||
unit.AI()->MovementInform(POINT_MOTION_TYPE, id);
|
||||
|
||||
if (TemporarySummon* pSummon = dynamic_cast<TemporarySummon*>(&unit))
|
||||
{
|
||||
if (Unit* pSummoner = pSummon->GetSummoner())
|
||||
{
|
||||
if (pSummoner->GetTypeId() == TYPEID_UNIT)
|
||||
{
|
||||
if (((Creature*)pSummoner)->AI())
|
||||
((Creature*)pSummoner)->AI()->SummonedMovementInform(&unit, POINT_MOTION_TYPE, id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template void PointMovementGenerator<Player>::Initialize(Player&);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue