hotfix 23.06.2026#1464
Conversation
|
Warning Review limit reached
More reviews will be available in 40 minutes and 26 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses rolling per-developer review limits. Reviews become available again as older review attempts age out of the rolling limit window. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
WalkthroughДобавлен host-part-ограниченный метод ChangesУлучшения системы тела
Sequence Diagram(s)sequenceDiagram
rect rgba(135, 100, 200, 0.5)
Note over GraftArachneCommand,BkmBodySharedSystem: Arachne Graft Flow
end
participant Admin as Admin/Toolshed
participant GraftArachneCommand
participant BkmBodySharedSystem
participant OrganRelationsSystem
Admin->>GraftArachneCommand: GraftArachne(ctx, entityUid)
GraftArachneCommand->>BkmBodySharedSystem: BodySupportsArachneGraft(input)
alt NPC с плоскими органами
BkmBodySharedSystem-->>GraftArachneCommand: false
GraftArachneCommand-->>Admin: ctx.ReportError(FlatOrgansError), null
else Тело поддерживает graft
BkmBodySharedSystem-->>GraftArachneCommand: true
GraftArachneCommand->>GraftArachneCommand: вставка arachne-органов, spider legs
GraftArachneCommand->>OrganRelationsSystem: WireGraftRelationships(body)
GraftArachneCommand->>BkmBodySharedSystem: SyncLegEntitiesForBody(body, bodyComp)
BkmBodySharedSystem-->>GraftArachneCommand: leg entities синхронизированы
end
sequenceDiagram
rect rgba(50, 150, 100, 0.5)
Note over SharedSurgerySystem,BkmBodySharedSystem: Surgery organ step (новый путь)
end
participant SharedSurgerySystem
participant BkmBodySharedSystem
participant InternalOrganHostCategory
SharedSurgerySystem->>BkmBodySharedSystem: TryGetInternalOrgansForHostPart(body, args.Part, organType)
BkmBodySharedSystem->>BkmBodySharedSystem: TryGetBodyPartOrgans(body, organType) → все органы типа
BkmBodySharedSystem->>InternalOrganHostCategory: фильтр по ожидаемой host-категории для args.Part
InternalOrganHostCategory-->>BkmBodySharedSystem: отфильтрованный список (Id, OrganComponent)
BkmBodySharedSystem-->>SharedSurgerySystem: true + список / false
SharedSurgerySystem->>SharedSurgerySystem: отмена шага или операция с первым органом
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
Content.Shared/Backmen/Body/Systems/BkmBodySharedSystem.Body.cs (1)
246-272: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winНе обходите финальную синхронизацию при
removeWounds: false.Line 246 возвращает управление до Line 271-272, поэтому
ForceRestoreBody(..., removeWounds: false)после восстановления органов не пересоберетLegEntitiesи не обновит скорость.🐛 Возможное исправление
- if (!removeWounds) - return; + void FinishRestore() + { + _organRelations.WireRelationships((ent, ent.Comp!)); + SyncLegEntities((ent, ent.Comp!)); + UpdateMovementSpeed(ent, ent.Comp!); + } + + if (!removeWounds) + { + FinishRestore(); + return; + } if (_trauma.TryGetBodyTraumas(ent, out var traumas, bodyComp: ent.Comp)) { foreach (var trauma in traumas) @@ - _organRelations.WireRelationships((ent, ent.Comp!)); - SyncLegEntities((ent, ent.Comp!)); - UpdateMovementSpeed(ent, ent.Comp!); + FinishRestore();🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@Content.Shared/Backmen/Body/Systems/BkmBodySharedSystem.Body.cs` around lines 246 - 272, When removeWounds is false, the early return statement in the if block prevents the final synchronization calls from executing, leaving the body state unsynchronized after organ restoration. Move the SyncLegEntities and UpdateMovementSpeed calls outside of the conditional removeWounds block so they execute regardless of whether wounds are being removed, ensuring complete body synchronization in all cases.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@Content.Shared/Backmen/Body/Systems/BkmBodySharedSystem.Woundables.cs`:
- Around line 160-163: The code retrieves the OrganComponent from hostPart and
uses its category to find organs in bodyId, but does not verify that hostPart
actually belongs to bodyId. This allows a body part from a different body to
incorrectly match organs in bodyId if they share the same category. Add a
validation check after obtaining hostOrgan (where you verify it exists and has a
category) to also ensure that hostOrgan.Body matches the bodyId parameter before
proceeding to search for organs with TryGetBodyPartOrgans.
---
Outside diff comments:
In `@Content.Shared/Backmen/Body/Systems/BkmBodySharedSystem.Body.cs`:
- Around line 246-272: When removeWounds is false, the early return statement in
the if block prevents the final synchronization calls from executing, leaving
the body state unsynchronized after organ restoration. Move the SyncLegEntities
and UpdateMovementSpeed calls outside of the conditional removeWounds block so
they execute regardless of whether wounds are being removed, ensuring complete
body synchronization in all cases.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 03b32e48-57a7-48de-a9c4-187dd063ca51
📒 Files selected for processing (12)
Content.Client/Backmen/Body/LooseOrganVisualSystem.csContent.IntegrationTests/Tests/Backmen/Body/DetachedLegFootReattachTest.csContent.IntegrationTests/Tests/Backmen/Body/GraftArachneRejuvenateTest.csContent.IntegrationTests/Tests/Backmen/Surgery/InternalOrganSurgeryTest.csContent.Server/Backmen/Administration/Commands/Toolshed/GraftArachneCommand.csContent.Shared/Backmen/Body/Systems/BkmBodySharedSystem.Body.csContent.Shared/Backmen/Body/Systems/BkmBodySharedSystem.Woundables.csContent.Shared/Backmen/Surgery/SharedSurgerySystem.Steps.csContent.Shared/Backmen/Surgery/SharedSurgerySystem.csResources/Locale/en-US/backmen/toolshed.ftlResources/Locale/ru-RU/backmen/toolshed.ftlResources/Prototypes/Body/base_organs.yml
💤 Files with no reviewable changes (1)
- Content.Client/Backmen/Body/LooseOrganVisualSystem.cs
| if (!TryComp<OrganComponent>(hostPart, out var hostOrgan) || hostOrgan.Category is not { } hostCategory) | ||
| return false; | ||
|
|
||
| if (!TryGetBodyPartOrgans(bodyId, organComponentType, out var all) || all == null) |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Проверьте, что hostPart принадлежит bodyId.
Line 160 берет категорию у hostPart, но не сверяет hostOrgan.Body; поэтому вызов с торсом/головой другого тела все равно найдет внутренние органы в bodyId для этой категории.
🐛 Возможное исправление
- if (!TryComp<OrganComponent>(hostPart, out var hostOrgan) || hostOrgan.Category is not { } hostCategory)
+ if (!TryComp<OrganComponent>(hostPart, out var hostOrgan) || hostOrgan.Category is not { } hostCategory)
+ return false;
+
+ if (hostOrgan.Body != bodyId)
return false;📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| if (!TryComp<OrganComponent>(hostPart, out var hostOrgan) || hostOrgan.Category is not { } hostCategory) | |
| return false; | |
| if (!TryGetBodyPartOrgans(bodyId, organComponentType, out var all) || all == null) | |
| if (!TryComp<OrganComponent>(hostPart, out var hostOrgan) || hostOrgan.Category is not { } hostCategory) | |
| return false; | |
| if (hostOrgan.Body != bodyId) | |
| return false; | |
| if (!TryGetBodyPartOrgans(bodyId, organComponentType, out var all) || all == null) |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@Content.Shared/Backmen/Body/Systems/BkmBodySharedSystem.Woundables.cs` around
lines 160 - 163, The code retrieves the OrganComponent from hostPart and uses
its category to find organs in bodyId, but does not verify that hostPart
actually belongs to bodyId. This allows a body part from a different body to
incorrectly match organs in bodyId if they share the same category. Add a
validation check after obtaining hostOrgan (where you verify it exists and has a
category) to also ensure that hostOrgan.Body matches the bodyId parameter before
proceeding to search for organs with TryGetBodyPartOrgans.
fix #1461
Summary by CodeRabbit
Release Notes
Bug Fixes
New Features
Chores