Skip to content

Commit

Permalink
Fixed a crash for ReleaseMaxOptimization builds
Browse files Browse the repository at this point in the history
  • Loading branch information
QuestionableM committed Feb 7, 2024
1 parent 265e450 commit ea9b51a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions Code/BetterPaintTool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<btVector3*>(&v_pPlayer->camera.position);
const btVector3 v_direction = *reinterpret_cast<btVector3*>(&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;
Expand Down
2 changes: 1 addition & 1 deletion SM-BetterPaintTool.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
<LanguageStandard>stdcpp14</LanguageStandard>
<AdditionalIncludeDirectories>$(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</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<Optimization>Disabled</Optimization>
<Optimization>MaxSpeed</Optimization>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<DebugInformationFormat>None</DebugInformationFormat>
</ClCompile>
Expand Down

0 comments on commit ea9b51a

Please sign in to comment.