Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CVector optional arguments - #3738 #3782

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
2 changes: 1 addition & 1 deletion Client/mods/deathmatch/logic/CPedSync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ void CPedSync::Packet_PedSync(NetBitStreamInterface& BitStream)
unsigned char ucFlags = 0;
BitStream.Read(ucFlags);

CVector vecPosition{ CVector::NoInit{} }, vecMoveSpeed{ CVector::NoInit{} };
CVector vecPosition{}, vecMoveSpeed{};
float fRotation, fHealth, fArmor;
bool bOnFire;
bool bIsInWater;
Expand Down
6 changes: 1 addition & 5 deletions Shared/sdk/CVector.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,9 @@ class CVector
float fY;
float fZ;

struct NoInit{};
TracerDS marked this conversation as resolved.
Show resolved Hide resolved

CVector(NoInit) {}

constexpr CVector() : fX(0.0f), fY(0.0f), fZ(0.0f) {}

constexpr CVector(float x, float y, float z) : fX(x), fY(y), fZ(z) {}
constexpr CVector(float x, float y = 0, float z = 0) : fX(x), fY(y), fZ(z) {}
TracerDS marked this conversation as resolved.
Show resolved Hide resolved
TracerDS marked this conversation as resolved.
Show resolved Hide resolved

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

Expand Down
Loading