Skip to content

fix: guard pre-5.4/5.5 UE APIs so the plugin builds on older UE (verified 5.3) - #493

Merged
ChiR24 merged 1 commit into
ChiR24:devfrom
max-modum:fix/ue-pre5.5-compat-version-guards
Jul 7, 2026
Merged

fix: guard pre-5.4/5.5 UE APIs so the plugin builds on older UE (verified 5.3)#493
ChiR24 merged 1 commit into
ChiR24:devfrom
max-modum:fix/ue-pre5.5-compat-version-guards

Conversation

@max-modum

Copy link
Copy Markdown
Contributor

Fixes #492.

Three files used newer-UE APIs without the version guards used elsewhere in the plugin, breaking compilation on UE older than 5.4 / 5.5. Verified building cleanly on UE 5.3.2 (0 errors, UnrealEditor-McpAutomationBridge.dll links). I built 5.3 specifically; the guards restore the pre-5.4 / pre-5.5 API forms, but I have not independently built 5.0–5.2. Guard style matches Core/Compatibility/McpVersionCompatibility.h.

Changes

  • EAllowShrinking::No overload (UE 5.4+) — guarded with >= 4; falls back to the bool overload on ≤5.3 (two call sites in …EnvironmentSnapshotPaths.cpp).
  • PhysicsEngine/SkeletalBodySetup.h (standalone header, UE 5.5+) — guarded with >= 5. On ≤5.4 the complete USkeletalBodySetup type is still reachable via PhysicsEngine/PhysicsAsset.h (its UE_ENABLE_INCLUDE_ORDER_DEPRECATED_IN_5_5 block, default-on there), so the SkeletalBodySetups[i]->… member access is unaffected.
  • Removed redundant #include "UObject/StrProperty.h"FStrProperty is declared in the already-included UObject/UnrealType.h on all UE versions.

No behavior change on 5.5+. CHANGELOG.md updated under [Unreleased].

Checklist

  • npm run lint — passes locally on this branch.
  • npm run test:smoke — passes locally on this branch (Smoke Test PASSED, 23 tools).
  • CHANGELOG.md updated under [Unreleased].

C++-only change to the bridge plugin; does not touch the TypeScript server. CI (lint/smoke/CodeQL) doesn't compile the plugin, so the UE 5.3 build above is the compile evidence.

…fied 5.3)

Three files used newer-UE APIs without the version guards used elsewhere in
the plugin, breaking compilation on UE older than 5.4/5.5:

- EAllowShrinking::No overload of FString::RightChopInline/LeftInline (UE 5.4+)
- standalone PhysicsEngine/SkeletalBodySetup.h include (UE 5.5+)
- redundant UObject/StrProperty.h include

Added the same #if ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= N guards
used elsewhere and dropped the redundant include (FStrProperty comes from the
already-included UObject/UnrealType.h). Verified building cleanly on UE 5.3.2.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

👋 Thanks for your first Pull Request! We love contributions. Please ensure you have signed off your commits and followed the contribution guidelines.

@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3133afdb-1f9d-4980-a0cc-66138f5c3c86

📥 Commits

Reviewing files that changed from the base of the PR and between 89aedb0 and 724d586.

📒 Files selected for processing (4)
  • CHANGELOG.md
  • plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/Domains/Environment/McpAutomationBridge_EnvironmentSnapshotPaths.cpp
  • plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/Domains/Skeleton/Physics/McpAutomationBridge_SkeletonHandlersPhysicsBodyRemoval.cpp
  • plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/Foundation/Reflection/McpPropertyReflectionPrivate.h
💤 Files with no reviewable changes (1)
  • plugins/McpAutomationBridge/Source/McpAutomationBridge/Private/Foundation/Reflection/McpPropertyReflectionPrivate.h

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Resolved build compatibility issues preventing the plugin from compiling on Unreal Engine versions older than 5.4/5.5. Compatibility patches have been applied to support earlier engine versions. Plugin now builds successfully on UE 5.3.2 and earlier.

Walkthrough

Adds ENGINE_MAJOR_VERSION/ENGINE_MINOR_VERSION preprocessor guards to two call sites in EnvironmentSnapshotPaths.cpp for EAllowShrinking::No (UE 5.4+) and to the SkeletalBodySetup.h include in SkeletonHandlersPhysicsBodyRemoval.cpp (UE 5.5+). Removes the redundant UObject/StrProperty.h include from McpPropertyReflectionPrivate.h. Documents the fix in CHANGELOG.md.

Changes

UE Version Compatibility Fixes

Layer / File(s) Summary
Version guards, redundant include removal, and changelog
plugins/.../Domains/Environment/McpAutomationBridge_EnvironmentSnapshotPaths.cpp, plugins/.../Domains/Skeleton/Physics/McpAutomationBridge_SkeletonHandlersPhysicsBodyRemoval.cpp, plugins/.../Foundation/Reflection/McpPropertyReflectionPrivate.h, CHANGELOG.md
RightChopInline and LeftInline calls using EAllowShrinking::No are wrapped in #if ENGINE_MINOR_VERSION >= 4 guards (falling back to false); PhysicsEngine/SkeletalBodySetup.h is conditionally included only on ENGINE_MINOR_VERSION >= 5; UObject/StrProperty.h is removed as redundant; changelog entry documents UE 5.3.2 build verification.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

  • ChiR24/Unreal_mcp#295: Both PRs make header/include adjustments in the McpAutomationBridge reflection area — this PR removes UObject/StrProperty.h from McpPropertyReflectionPrivate.h while the referenced PR adds UObject/TextProperty.h to McpPropertyReflection.cpp.

Suggested labels

size/xs, area/plugin

Suggested reviewers

  • ChiR24

Poem

🐇 Hop hop, the guards are set,
Old engine versions won't fret.
EAllowShrinking? Wrapped with care,
Redundant headers stripped bare.
UE 5.3 compiles again — hooray!
A rabbit fixed the build today! 🎉

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: guarding pre-5.4/5.5 UE APIs to fix compilation on older engine versions, with verification on UE 5.3.
Description check ✅ Passed The description covers the issue summary, specific changes to three files, testing evidence, and a checklist. While it doesn't follow the exact template structure with checkboxes, it provides comprehensive information about the fix.
Linked Issues check ✅ Passed The PR implements all three objectives from issue #492: adding version guards for EAllowShrinking::No overload (UE 5.4+), guarding PhysicsEngine/SkeletalBodySetup.h (UE 5.5+), and removing the redundant StrProperty.h include.
Out of Scope Changes check ✅ Passed All changes are directly scoped to addressing issue #492: version guards for unguarded APIs in three files plus CHANGELOG.md update documenting the fix.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot added the size/xs label Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Plugin fails to compile on UE ≤5.4 — three newer-UE APIs used without the version guards used elsewhere

2 participants