From ea9b51a22763d7a4aa33e0e78f213e3dd0a5e63a Mon Sep 17 00:00:00 2001 From: QuestionableM <77170113+QuestionableM@users.noreply.github.com> Date: Wed, 7 Feb 2024 14:00:59 -0700 Subject: [PATCH] Fixed a crash for ReleaseMaxOptimization builds --- Code/BetterPaintTool.cpp | 6 ++++-- SM-BetterPaintTool.vcxproj | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Code/BetterPaintTool.cpp b/Code/BetterPaintTool.cpp index ffe9cbb..0a71ff4 100644 --- a/Code/BetterPaintTool.cpp +++ b/Code/BetterPaintTool.cpp @@ -138,8 +138,10 @@ void BetterPaintTool::h_update(BetterPaintTool* self, float dt) btCollisionWorld* v_pCollWorld = v_pPhysBase->collision_world2; MyPlayer* v_pPlayer = MyPlayer::GetInstance(); - const btVector3 v_ray_start = *reinterpret_cast(&v_pPlayer->camera.position); - const btVector3 v_direction = *reinterpret_cast(&v_pPlayer->camera.direction); + const btVector3 v_ray_start(v_pPlayer->camera.position.x, + v_pPlayer->camera.position.y, v_pPlayer->camera.position.z); + const btVector3 v_direction(v_pPlayer->camera.direction.x, + v_pPlayer->camera.direction.y, v_pPlayer->camera.direction.z); const btVector3 v_ray_end = v_ray_start + v_direction * 7.0f; ColorIndexRayResult v_callback; diff --git a/SM-BetterPaintTool.vcxproj b/SM-BetterPaintTool.vcxproj index 4f64ed7..818735d 100644 --- a/SM-BetterPaintTool.vcxproj +++ b/SM-BetterPaintTool.vcxproj @@ -119,7 +119,7 @@ stdcpp14 $(SolutionDir)Dependencies\MyGUIEngine\include;$(SolutionDir)Dependencies\boost_uuid\include;$(SolutionDir)Dependencies\MinHook\include;$(SolutionDir)Dependencies\jsoncpp\include;$(SolutionDIr)Dependencies\SmSdk\include;$(SolutionDir)Dependencies\bullet3;$(SolutionDir)Code true - Disabled + MaxSpeed false None