mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
Merge commit 'origin/master' into 310 (at [7360])
This commit is contained in:
commit
ce8bd43bef
69 changed files with 2352 additions and 1751 deletions
|
|
@ -43,6 +43,7 @@
|
|||
#include "GridNotifiersImpl.h"
|
||||
#include "CellImpl.h"
|
||||
#include "Path.h"
|
||||
#include "Traveller.h"
|
||||
|
||||
#include <math.h>
|
||||
|
||||
|
|
@ -232,31 +233,26 @@ void Unit::SendMonsterMoveWithSpeedToCurrentDestination(Player* player)
|
|||
{
|
||||
float x, y, z;
|
||||
if(GetMotionMaster()->GetDestination(x, y, z))
|
||||
SendMonsterMoveWithSpeed(x, y, z, GetUnitMovementFlags(), 0, player);
|
||||
SendMonsterMoveWithSpeed(x, y, z, 0, player);
|
||||
}
|
||||
|
||||
void Unit::SendMonsterMoveWithSpeed(float x, float y, float z, uint32 MovementFlags, uint32 transitTime, Player* player)
|
||||
void Unit::SendMonsterMoveWithSpeed(float x, float y, float z, uint32 transitTime, Player* player)
|
||||
{
|
||||
if (!transitTime)
|
||||
{
|
||||
float dx = x - GetPositionX();
|
||||
float dy = y - GetPositionY();
|
||||
float dz = z - GetPositionZ();
|
||||
|
||||
float dist = ((dx*dx) + (dy*dy) + (dz*dz));
|
||||
if(dist<0)
|
||||
dist = 0;
|
||||
if(GetTypeId()==TYPEID_PLAYER)
|
||||
{
|
||||
Traveller<Player> traveller(*(Player*)this);
|
||||
transitTime = traveller.GetTotalTrevelTimeTo(x,y,z);
|
||||
}
|
||||
else
|
||||
dist = sqrt(dist);
|
||||
|
||||
double speed = GetSpeed((MovementFlags & MOVEMENTFLAG_WALK_MODE) ? MOVE_WALK : MOVE_RUN);
|
||||
if(speed<=0)
|
||||
speed = 2.5f;
|
||||
speed *= 0.001f;
|
||||
transitTime = static_cast<uint32>(dist / speed + 0.5);
|
||||
{
|
||||
Traveller<Creature> traveller(*(Creature*)this);
|
||||
transitTime = traveller.GetTotalTrevelTimeTo(x,y,z);
|
||||
}
|
||||
}
|
||||
//float orientation = (float)atan2((double)dy, (double)dx);
|
||||
SendMonsterMove(x, y, z, 0, MovementFlags, transitTime, player);
|
||||
SendMonsterMove(x, y, z, 0, GetUnitMovementFlags(), transitTime, player);
|
||||
}
|
||||
|
||||
void Unit::SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint8 type, uint32 MovementFlags, uint32 Time, Player* player)
|
||||
|
|
@ -1722,7 +1718,6 @@ void Unit::CalcAbsorbResist(Unit *pVictim,SpellSchoolMask schoolMask, DamageEffe
|
|||
Unit* caster = (*i)->GetCaster();
|
||||
if (!caster)
|
||||
break;
|
||||
int32 reflectDamage = 0;
|
||||
AuraList const& vOverRideCS = caster->GetAurasByType(SPELL_AURA_DUMMY);
|
||||
for(AuraList::const_iterator k = vOverRideCS.begin(); k != vOverRideCS.end(); ++k)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue