mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
[9435] Avoid useless creature running around at evade
* If creature near respawn point and by defult do random movement then restart from current point * If creature have default waypoints movegen restart from last updated point. Not reload waypoints
This commit is contained in:
parent
f47f5a1deb
commit
d3fc17a81d
7 changed files with 41 additions and 12 deletions
|
|
@ -39,14 +39,14 @@ HomeMovementGenerator<Creature>::Reset(Creature &)
|
|||
void
|
||||
HomeMovementGenerator<Creature>::_setTargetLocation(Creature & owner)
|
||||
{
|
||||
if( !&owner )
|
||||
return;
|
||||
|
||||
if( owner.hasUnitState(UNIT_STAT_NOT_MOVE) )
|
||||
if (owner.hasUnitState(UNIT_STAT_NOT_MOVE))
|
||||
return;
|
||||
|
||||
float x, y, z;
|
||||
owner.GetRespawnCoord(x, y, z);
|
||||
|
||||
// at apply we can select more nice return points base at current movegen
|
||||
if (owner.GetMotionMaster()->empty() || !owner.GetMotionMaster()->top()->GetResetPosition(owner,x,y,z))
|
||||
owner.GetRespawnCoord(x, y, z);
|
||||
|
||||
CreatureTraveller traveller(owner);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue