Core/Units:

- Implement UNIT_FIELD_HOVERHEIGHT (requires DB data). This field, sent in update object packet, will determine the height at which a creature hovers if it has movementflag_hover applied. Note that hovering will now update the server-sided z-coordinate by the value of this field, and that all subsequent positional updates to the client will need to send z coordinate MINUS the hover height offset, or the hoverheight will be visually doubled client side.
- Correct our usage of movementflag_flying, movementflag_can_fly, movementflag_hover and movementflag_disable_gravity (previously levitate), and how they relate to InhabitType in the database. This fixes "flying creatures on steroids" bug (wings flapping too fast), and potentially a lot of visual issues in AI scripts. Note that a lot of scripts still set wrong movementflags, these need to be fixed on a case by case basis.
- Send correct packets for SPELL_AURA_FEATHER_FALL, SPELL_AURA_WATER_WALK and SPELL_AURA_HOVER apply/unapply.
- Send correct packet contents for movement update in Unit::SetSpeed.
- Misc. cleanup in affected scripts.
This commit is contained in:
Machiavelli committed 2012-03-12 00:53:45 +01:00
1 parent 5ca27f40cc
commit 03a24a84e4
74 files changed
+489 -384

No files matched your search

+14 -5
View File
@@ -340,7 +340,10 @@ void Object::_BuildMovementUpdate(ByteBuffer* data, uint16 flags) const
*data << ((WorldObject*)this)->GetPositionX();
*data << ((WorldObject*)this)->GetPositionY();
*data << ((WorldObject*)this)->GetPositionZ();
if (isType(TYPEMASK_UNIT))
*data << ((Unit*)this)->GetPositionZMinusOffset();
else
*data << ((WorldObject*)this)->GetPositionZ();
if (transport)
{
@@ -352,7 +355,10 @@ void Object::_BuildMovementUpdate(ByteBuffer* data, uint16 flags) const
{
*data << ((WorldObject*)this)->GetPositionX();
*data << ((WorldObject*)this)->GetPositionY();
*data << ((WorldObject*)this)->GetPositionZ();
if (isType(TYPEMASK_UNIT))
*data << ((Unit*)this)->GetPositionZMinusOffset();
else
*data << ((WorldObject*)this)->GetPositionZ();
}
*data << ((WorldObject*)this)->GetOrientation();
@@ -369,7 +375,10 @@ void Object::_BuildMovementUpdate(ByteBuffer* data, uint16 flags) const
{
*data << ((WorldObject*)this)->GetPositionX();
*data << ((WorldObject*)this)->GetPositionY();
*data << ((WorldObject*)this)->GetPositionZ();
if (isType(TYPEMASK_UNIT))
*data << ((Unit*)this)->GetPositionZMinusOffset();
else
*data << ((WorldObject*)this)->GetPositionZ();
*data << ((WorldObject*)this)->GetOrientation();
}
}
@@ -1557,7 +1566,7 @@ void WorldObject::UpdateAllowedPositionZ(float x, float y, float &z) const
{
// non fly unit don't must be in air
// non swim unit must be at ground (mostly speedup, because it don't must be in water and water level check less fast
if (!ToCreature()->canFly())
if (!ToCreature()->CanFly())
{
bool canSwim = ToCreature()->canSwim();
float ground_z = z;
@@ -1583,7 +1592,7 @@ void WorldObject::UpdateAllowedPositionZ(float x, float y, float &z) const
case TYPEID_PLAYER:
{
// for server controlled moves playr work same as creature (but it can always swim)
if (!ToPlayer()->canFly())
if (!ToPlayer()->CanFly())
{
float ground_z = z;
float max_z = GetBaseMap()->GetWaterOrGroundLevel(x, y, z, &ground_z, !ToUnit()->HasAuraType(SPELL_AURA_WATER_WALK));