Rebase resync

This commit is contained in:
Antz 2020-02-17 09:19:44 +00:00
parent a0797532e8
commit 1997c1e903
3106 changed files with 11118 additions and 627576 deletions

View file

@ -1,4 +1,4 @@
/*
/**
* This code is part of MaNGOS. Contributor & Copyright details are in AUTHORS/THANKS.
*
* This program is free software; you can redistribute it and/or modify
@ -29,6 +29,9 @@
template<class T>
void PointMovementGenerator<T>::Initialize(T& unit)
{
if (unit.hasUnitState(UNIT_STAT_CAN_NOT_REACT | UNIT_STAT_NOT_MOVE))
return;
if (!unit.IsStopped())
unit.StopMoving();
@ -74,7 +77,9 @@ bool PointMovementGenerator<T>::Update(T& unit, const uint32& diff)
return true;
}
unit.addUnitState(UNIT_STAT_ROAMING_MOVE);
if (!unit.hasUnitState(UNIT_STAT_ROAMING_MOVE) && unit.movespline->Finalized())
Initialize(unit);
return !unit.movespline->Finalized();
}
@ -133,7 +138,7 @@ void EffectMovementGenerator::Finalize(Unit& unit)
if (((Creature&)unit).AI() && unit.movespline->Finalized())
((Creature&)unit).AI()->MovementInform(EFFECT_MOTION_TYPE, m_Id);
// Need restore previous movement since we have no proper states system
if (unit.isAlive() && !unit.hasUnitState(UNIT_STAT_CONFUSED | UNIT_STAT_FLEEING))
if (unit.isAlive() && !unit.hasUnitState(UNIT_STAT_CONFUSED | UNIT_STAT_FLEEING | UNIT_STAT_NO_COMBAT_MOVEMENT))
{
if (Unit* victim = unit.getVictim())
unit.GetMotionMaster()->MoveChase(victim);