feat(Core/Grids): Implement visibility notifier (#15919)

* Cherry-picked from TrinityCore (unable to find author)
This commit is contained in:
AG
2023-09-28 22:28:28 +02:00
committed by GitHub
parent 29af6cc886
commit 2779833768
33 changed files with 1254 additions and 510 deletions

View File

@@ -379,14 +379,23 @@ class MovableMapObject
template<class T> friend class RandomMovementGenerator;
protected:
MovableMapObject() = default;
MovableMapObject() : _moveState(MAP_OBJECT_CELL_MOVE_NONE)
{
_newPosition.Relocate(0.0f, 0.0f, 0.0f, 0.0f);
}
private:
Cell _currentCell;
[[nodiscard]] Cell const& GetCurrentCell() const { return _currentCell; }
void SetCurrentCell(Cell const& cell) { _currentCell = cell; }
Cell _currentCell;
MapObjectCellMoveState _moveState{MAP_OBJECT_CELL_MOVE_NONE};
MapObjectCellMoveState _moveState;
Position _newPosition;
void SetNewCellPosition(float x, float y, float z, float o)
{
_moveState = MAP_OBJECT_CELL_MOVE_ACTIVE;
_newPosition.Relocate(x, y, z, o);
}
};
class WorldObject : public Object, public WorldLocation
@@ -538,7 +547,7 @@ public:
void GetDeadCreatureListInGrid(std::list<Creature*>& lList, float maxSearchRange, bool alive = false) const;
void DestroyForNearbyPlayers();
virtual void UpdateObjectVisibility(bool forced = true, bool fromUpdate = false);
virtual void UpdateObjectVisibility(bool forced = true);
void BuildUpdate(UpdateDataMapType& data_map, UpdatePlayerSet& player_set) override;
void GetCreaturesWithEntryInRange(std::list<Creature*>& creatureList, float radius, uint32 entry);