Skip to content

Commit 64f1724

Browse files
committed
Updated according to reviews
1 parent e917272 commit 64f1724

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

Client/mods/deathmatch/logic/CPedSync.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ void CPedSync::Packet_PedSync(NetBitStreamInterface& BitStream)
179179
unsigned char ucFlags = 0;
180180
BitStream.Read(ucFlags);
181181

182-
CVector vecPosition{}, vecMoveSpeed{};
182+
CVector vecPosition{ CVector::NoInit{} }, vecMoveSpeed{ CVector::NoInit{} };
183183
float fRotation, fHealth, fArmor;
184184
bool bOnFire;
185185
bool bIsInWater;

Shared/sdk/CVector.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,12 @@ class CVector
3030
float fY;
3131
float fZ;
3232

33-
constexpr CVector() : fX(0.0f), fY(0.0f), fZ(0.0f) {}
33+
struct NoInit {};
34+
constexpr CVector(NoInit) noexcept {}
3435

35-
constexpr CVector(float x, float y = 0, float z = 0) : fX(x), fY(y), fZ(z) {}
36+
constexpr CVector() noexcept : fX(0.0f), fY(0.0f), fZ(0.0f) {}
37+
38+
constexpr explicit CVector(float x, float y = 0.0f, float z = 0.0f) noexcept : fX(x), fY(y), fZ(z) {}
3639

3740
constexpr CVector(const CVector4D& vec) noexcept : fX(vec.fX), fY(vec.fY), fZ(vec.fZ) {}
3841

0 commit comments

Comments
 (0)