mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 10:37:02 +00:00
[11222] Move possition setup for Creature and subclases before Create call.
Some called from Create code can req. proper pos setup for creature. Bad side: But in way how currently code orginized impossible setup excetly position for most Creature sublasses. So in this part need more work.
This commit is contained in:
parent
c132e54f73
commit
51b4556c4b
7 changed files with 171 additions and 105 deletions
|
|
@ -1653,6 +1653,13 @@ Creature* WorldObject::SummonCreature(uint32 id, float x, float y, float z, floa
|
|||
if (GetTypeId()==TYPEID_PLAYER)
|
||||
team = ((Player*)this)->GetTeam();
|
||||
|
||||
// FIXME: Setup near to finish point because GetObjectBoundingRadius set in Create but some Create calls can be dependent from proper position
|
||||
// if creature have creature_template_addon.auras with persistent point for example or script call
|
||||
if (x == 0.0f && y == 0.0f && z == 0.0f)
|
||||
GetClosePoint(x, y, z, 0);
|
||||
|
||||
pCreature->Relocate(x, y, z, ang);
|
||||
|
||||
if (!pCreature->Create(GetMap()->GenerateLocalLowGuid(HIGHGUID_UNIT), GetMap(), GetPhaseMask(), id, team))
|
||||
{
|
||||
delete pCreature;
|
||||
|
|
@ -1660,9 +1667,11 @@ Creature* WorldObject::SummonCreature(uint32 id, float x, float y, float z, floa
|
|||
}
|
||||
|
||||
if (x == 0.0f && y == 0.0f && z == 0.0f)
|
||||
{
|
||||
GetClosePoint(x, y, z, pCreature->GetObjectBoundingRadius());
|
||||
pCreature->Relocate(x, y, z, ang);
|
||||
}
|
||||
|
||||
pCreature->Relocate(x, y, z, ang);
|
||||
pCreature->SetSummonPoint(x, y, z, ang);
|
||||
|
||||
if(!pCreature->IsPositionValid())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue