fix(VR): allow for Engine Fixes VR 7.x (NG)#2107
Conversation
📝 WalkthroughWalkthroughRefactors DLL-loading in Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
No actionable suggestions for changed features. |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/XSEPlugin.cpp (1)
197-210: Optional: unify missing-DLL error construction for consistency.The VR branch uses a hardcoded message while the non-VR branch uses formatted path text. A tiny helper would reduce duplication and keep future messages aligned.
Suggested cleanup
+ auto pushMissingDllError = [&](std::string_view dllRequirement) { + auto errorMessage = std::format("Required DLL {} was missing", dllRequirement); + logger::error("{}", errorMessage); + errors.push_back(errorMessage); + }; + // Engine Fixes: VR accepts either EngineFixesVR.dll or the EngineFixes.dll NG if (REL::Module::IsVR()) { if (!LoadLibrary(L"Data/SKSE/Plugins/EngineFixesVR.dll") && !LoadLibrary(L"Data/SKSE/Plugins/EngineFixes.dll")) { - auto errorMessage = std::string("Required DLL EngineFixesVR.dll or EngineFixes.dll was missing"); - logger::error("{}", errorMessage); - errors.push_back(errorMessage); + pushMissingDllError("EngineFixesVR.dll or EngineFixes.dll"); } } else { if (!LoadLibrary(L"Data/SKSE/Plugins/EngineFixes.dll")) { - auto errorMessage = std::format("Required DLL {} was missing", stl::utf16_to_utf8(L"Data/SKSE/Plugins/EngineFixes.dll").value_or("<unicode conversion error>"s)); - logger::error("{}", errorMessage); - errors.push_back(errorMessage); + pushMissingDllError(stl::utf16_to_utf8(L"Data/SKSE/Plugins/EngineFixes.dll").value_or("<unicode conversion error>"s)); } }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/XSEPlugin.cpp` around lines 197 - 210, Unify the missing-DLL error construction by introducing a small helper (e.g., MakeMissingDllMessage or formatMissingDllError) and use it in both branches where LoadLibrary is called; replace the hardcoded VR message and the formatted non-VR message with calls that produce the same style (use stl::utf16_to_utf8 and std::format inside the helper) and then pass the result to logger::error and errors.push_back so both the VR branch (checking EngineFixesVR.dll / EngineFixes.dll) and the non-VR branch (EngineFixes.dll) produce consistent messages.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/XSEPlugin.cpp`:
- Around line 197-210: Unify the missing-DLL error construction by introducing a
small helper (e.g., MakeMissingDllMessage or formatMissingDllError) and use it
in both branches where LoadLibrary is called; replace the hardcoded VR message
and the formatted non-VR message with calls that produce the same style (use
stl::utf16_to_utf8 and std::format inside the helper) and then pass the result
to logger::error and errors.push_back so both the VR branch (checking
EngineFixesVR.dll / EngineFixes.dll) and the non-VR branch (EngineFixes.dll)
produce consistent messages.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 9cb807e0-a707-4748-828b-7a2937fc6350
📒 Files selected for processing (1)
src/XSEPlugin.cpp
|
✅ A pre-release build is available for this PR: |
davo0411
left a comment
There was a problem hiding this comment.
this won't add any weird overhead or annoying maintenance right? Supporting two sets of engine fixes? Will there come a time where we need xyz feature from only the new versions ?
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/XSEPlugin.cpp (1)
203-212: Log which Engine Fixes DLL satisfied the VR check.The runtime-gated fallback looks right. One small follow-up: emit an info line for the DLL that matched so mixed-install reports show whether VR found
EngineFixesVR.dlldirectly or fell back toEngineFixes.dll.As per coding guidelines "Ensure code changes work across SE/AE/VR Skyrim variants using runtime detection and `REL::RelocateMember()` patterns for compatibility"💡 Possible tweak
// Engine Fixes: VR accepts either EngineFixesVR.dll or the EngineFixes.dll NG if (REL::Module::IsVR()) { - if (!LoadLibrary(L"Data/SKSE/Plugins/EngineFixesVR.dll") && !LoadLibrary(L"Data/SKSE/Plugins/EngineFixes.dll")) { + if (LoadLibrary(L"Data/SKSE/Plugins/EngineFixesVR.dll")) { + logger::info("Detected EngineFixesVR.dll"); + } else if (LoadLibrary(L"Data/SKSE/Plugins/EngineFixes.dll")) { + logger::info("Detected EngineFixes.dll"); + } else { pushMissingDllError("EngineFixesVR.dll or EngineFixes.dll"); } } else {🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/XSEPlugin.cpp` around lines 203 - 212, The VR/desktop DLL probing block logs failures but not which DLL actually satisfied the check; update the REL::Module::IsVR() branch so after a successful LoadLibrary call you emit an info log indicating which DLL was loaded (e.g., "Loaded EngineFixesVR.dll" or "Fell back to EngineFixes.dll") using the same logging mechanism as pushMissingDllError, and likewise emit an info log in the non-VR path when LoadLibrary(L"Data/SKSE/Plugins/EngineFixes.dll") succeeds; keep the existing failure calls to pushMissingDllError unchanged and reference the exact DLL names and functions REL::Module::IsVR(), LoadLibrary, and pushMissingDllError when making the change.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/XSEPlugin.cpp`:
- Around line 203-212: The VR/desktop DLL probing block logs failures but not
which DLL actually satisfied the check; update the REL::Module::IsVR() branch so
after a successful LoadLibrary call you emit an info log indicating which DLL
was loaded (e.g., "Loaded EngineFixesVR.dll" or "Fell back to EngineFixes.dll")
using the same logging mechanism as pushMissingDllError, and likewise emit an
info log in the non-VR path when
LoadLibrary(L"Data/SKSE/Plugins/EngineFixes.dll") succeeds; keep the existing
failure calls to pushMissingDllError unchanged and reference the exact DLL names
and functions REL::Module::IsVR(), LoadLibrary, and pushMissingDllError when
making the change.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 2d6bae6f-7491-431d-8692-74f4bbd15e79
📒 Files selected for processing (1)
src/XSEPlugin.cpp
Summary by CodeRabbit