From 2a587e5ac43ffd274ee7a1feb3ce2e35c2ae2978 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 4 Jun 2023 18:27:05 +0200 Subject: Core/Misc: Remove unwanted position converstions from a single float --- src/server/game/Entities/Object/Position.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/server/game/Entities/Object') diff --git a/src/server/game/Entities/Object/Position.h b/src/server/game/Entities/Object/Position.h index 83633acc04c..a9713f9443c 100644 --- a/src/server/game/Entities/Object/Position.h +++ b/src/server/game/Entities/Object/Position.h @@ -26,7 +26,10 @@ class ByteBuffer; struct TC_GAME_API Position { - Position(float x = 0, float y = 0, float z = 0, float o = 0) + Position() + : m_positionX(0.0f), m_positionY(0.0f), m_positionZ(0.0f), m_orientation(0.0f) { } + + Position(float x, float y, float z = 0.0f, float o = 0.0f) : m_positionX(x), m_positionY(y), m_positionZ(z), m_orientation(NormalizeOrientation(o)) { } // streamer tags @@ -165,7 +168,10 @@ public: class WorldLocation : public Position { public: - explicit WorldLocation(uint32 _mapId = MAPID_INVALID, float x = 0.f, float y = 0.f, float z = 0.f, float o = 0.f) + explicit WorldLocation() + : m_mapId(MAPID_INVALID) { } + + explicit WorldLocation(uint32 _mapId, float x, float y, float z = 0.0f, float o = 0.0f) : Position(x, y, z, o), m_mapId(_mapId) { } WorldLocation(uint32 mapId, Position const& position) @@ -203,7 +209,8 @@ TC_GAME_API ByteBuffer& operator<<(ByteBuffer& buf, Position::ConstStreamer struct TaggedPosition { - TaggedPosition(float x = 0.0f, float y = 0.0f, float z = 0.0f, float o = 0.0f) : Pos(x, y, z, o) { } + TaggedPosition() { } + TaggedPosition(float x, float y, float z = 0.0f, float o = 0.0f) : Pos(x, y, z, o) { } TaggedPosition(Position const& pos) : Pos(pos) { } TaggedPosition& operator=(Position const& pos) -- cgit v1.2.3