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:
@@ -702,6 +702,12 @@ void Map::PlayerRelocation(Player* player, float x, float y, float z, float orie
|
||||
Cell old_cell(player->GetPositionX(), player->GetPositionY());
|
||||
Cell new_cell(x, y);
|
||||
|
||||
//! If hovering, always increase our server-side Z position
|
||||
//! Client automatically projects correct position based on Z coord sent in monster move
|
||||
//! and UNIT_FIELD_HOVERHEIGHT sent in object updates
|
||||
if (player->HasUnitMovementFlag(MOVEMENTFLAG_HOVER))
|
||||
z += player->GetFloatValue(UNIT_FIELD_HOVERHEIGHT);
|
||||
|
||||
player->Relocate(x, y, z, orientation);
|
||||
if (player->IsVehicle())
|
||||
player->GetVehicleKit()->RelocatePassengers(x, y, z, orientation);
|
||||
@@ -731,6 +737,12 @@ void Map::CreatureRelocation(Creature* creature, float x, float y, float z, floa
|
||||
if (!respawnRelocationOnFail && !getNGrid(new_cell.GridX(), new_cell.GridY()))
|
||||
return;
|
||||
|
||||
//! If hovering, always increase our server-side Z position
|
||||
//! Client automatically projects correct position based on Z coord sent in monster move
|
||||
//! and UNIT_FIELD_HOVERHEIGHT sent in object updates
|
||||
if (creature->HasUnitMovementFlag(MOVEMENTFLAG_HOVER))
|
||||
z += creature->GetFloatValue(UNIT_FIELD_HOVERHEIGHT);
|
||||
|
||||
// delay creature move for grid/cell to grid/cell moves
|
||||
if (old_cell.DiffCell(new_cell) || old_cell.DiffGrid(new_cell))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user