Skip to content

Commit

Permalink
Fix UE5.4 head aiming/motion controls
Browse files Browse the repository at this point in the history
  • Loading branch information
praydog committed Jul 19, 2024
1 parent 3033c62 commit 53709ac
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions src/mods/vr/IXRTrackingSystemHook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,17 @@ detail::IXRTrackingSystemVT& get_tracking_system_vtable(std::optional<std::strin
SPDLOG_INFO("Found version {}.{} from executable (disk version)", HIWORD(version.dwFileVersionMS), LOWORD(version.dwFileVersionMS));
}

// TODO: actually dump 5.2
// TODO: actually dump 5.4
if (version.dwFileVersionMS == 0x50004 || str_version.starts_with("5.4")) {
return ue5_3::IXRTrackingSystemVT::get();
}

// >= 5.3
if (version.dwFileVersionMS == 0x50003 || str_version.starts_with("5.3")) {
return ue5_3::IXRTrackingSystemVT::get();
}

// TODO: actually dump 5.2
// >= 5.2
if (version.dwFileVersionMS == 0x50002 || str_version.starts_with("5.2")) {
return ue5_1::IXRTrackingSystemVT::get();
Expand Down Expand Up @@ -125,6 +130,11 @@ detail::IXRCameraVT& get_camera_vtable(std::optional<std::string> version_overri
version.dwFileVersionMS = 0;
}

// TODO: actually dump 5.4
if (version.dwFileVersionMS == 0x50004 || str_version.starts_with("5.4")) {
return ue5_3::IXRCameraVT::get();
}

// TODO: actually dump 5.2
if (version.dwFileVersionMS == 0x50003 || str_version.starts_with("5.3")) {
return ue5_3::IXRCameraVT::get();
Expand Down Expand Up @@ -207,11 +217,17 @@ detail::IHeadMountedDisplayVT& get_hmd_vtable(std::optional<std::string> version
version.dwFileVersionMS = 0;
}

// TODO: actually dump 5.2
// TODO: actually dump 5.4
if (version.dwFileVersionMS == 0x50004 || str_version.starts_with("5.4")) {
return ue5_3::IHeadMountedDisplayVT::get();
}

// 5.3
if (version.dwFileVersionMS == 0x50003 || str_version.starts_with("5.3")) {
return ue5_3::IHeadMountedDisplayVT::get();
}

// TODO: actually dump 5.2
// >= 5.2
if (version.dwFileVersionMS == 0x50002 || str_version.starts_with("5.2")) {
return ue5_1::IHeadMountedDisplayVT::get();
Expand Down

0 comments on commit 53709ac

Please sign in to comment.