Фиксы и дырочка в моем очке#277
Conversation
Пофикшен баг с балансом и пересадкой мозга. Добавлена система пулевых отверстий в хранилищах топлива и тд
|
Warning Review limit reached
More reviews will be available in 57 minutes and 46 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 adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughДобавлены ChangesTank Leak System
Bank Balance Sync
Sequence Diagram(s)sequenceDiagram
participant DestructibleSystem
participant TankLeakBehavior
participant TankLeakSystem
participant SharedSolutionContainerSystem
participant PuddleSystem
DestructibleSystem->>TankLeakBehavior: Execute(owner, system)
TankLeakBehavior->>TankLeakSystem: EnsureComp TankLeakComponent
loop LeaksToAdd раз
TankLeakBehavior->>TankLeakSystem: AddLeak(owner, comp)
TankLeakSystem->>TankLeakSystem: LeakCount++, Dirty
alt LeakCount >= MaxLeaks
TankLeakSystem->>SharedSolutionContainerSystem: TryGetSolution(uid, comp.Solution)
TankLeakSystem->>PuddleSystem: TrySpillAt(uid, solution)
TankLeakSystem->>TankLeakSystem: QueueDel(uid)
end
end
loop каждые LeakInterval секунд (Update)
TankLeakSystem->>SharedSolutionContainerSystem: SplitSolution(LeakRatePerHole * LeakCount)
TankLeakSystem->>PuddleSystem: TrySpillAt(coords, split, sound=false)
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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: 3
🤖 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.Server/Chemistry/EntitySystems/TankLeakSystem.cs`:
- Around line 67-74: The leak interval processing in TankLeakSystem.cs currently
only handles one leak tick per frame update, causing the actual leak rate to be
lower than expected when frameTime is large. Replace the single if check for
comp.LeakAccumulator < LeakInterval with a while loop that continues to process
and subtract LeakInterval from comp.LeakAccumulator for each accumulated
interval, ensuring that all accumulated leak intervals within a single frame are
properly accounted for in the leakAmount calculation.
In `@Resources/Locale/en-US/chemistry/components/tank-leak-component.ftl`:
- Around line 1-2: The tank-leak-popup and tank-leak-destroy-popup strings in
the Fluent template are using CAPITALIZE() function without passing any
argument, which means the entity name is not being included in the popup
messages. Modify both strings to pass the $entity parameter to the CAPITALIZE()
function so that the entity name is properly displayed in the messages when
TankLeakSystem triggers these popups.
In `@Resources/Locale/ru-RU/chemistry/components/tank-leak-component.ftl`:
- Around line 1-2: The Russian localization strings tank-leak-popup and
tank-leak-destroy-popup have incomplete or missing entity parameter
placeholders. In tank-leak-popup, replace the empty placeholder expression with
a proper reference to the entity parameter. In tank-leak-destroy-popup, add the
entity parameter as an argument to the CAPITALIZE() function so it receives the
entity name to display. These strings receive an entity parameter from
TankLeakSystem.cs (at lines 36 and 43), so ensure both localization entries use
the correct placeholder syntax to display the entity name to players.
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: fd252d64-5a03-4b7b-a67e-8a742711a9c0
📒 Files selected for processing (12)
Content.Server/Chemistry/EntitySystems/TankLeakSystem.csContent.Server/Destructible/Thresholds/Behaviors/TankLeakBehavior.csContent.Server/_NF/Shuttles/Bank/BankSystem.csContent.Shared/Chemistry/Components/TankLeakComponent.csResources/Locale/en-US/chemistry/components/tank-leak-component.ftlResources/Locale/ru-RU/chemistry/components/tank-leak-component.ftlResources/Prototypes/Entities/Structures/Power/Generation/portable_generator.ymlResources/Prototypes/Entities/Structures/Storage/Tanks/base_structuretanks.ymlResources/Prototypes/Entities/Structures/Storage/barrels.ymlResources/Prototypes/Entities/Structures/Storage/tanks.ymlResources/Prototypes/Entities/Structures/Wallmounts/walldispenser.ymlResources/Prototypes/_Crescent/Power/boriaticgenerators.yml
| comp.LeakAccumulator += frameTime; | ||
| if (comp.LeakAccumulator < LeakInterval) | ||
| continue; | ||
|
|
||
| comp.LeakAccumulator -= LeakInterval; | ||
|
|
||
| var leakAmount = comp.LeakRatePerHole * comp.LeakCount; | ||
|
|
There was a problem hiding this comment.
Пропускаются интервалы утечки при просадке frameTime.
Сейчас за апдейт обрабатывается только один тик утечки, поэтому при frameTime > 1f фактическая скорость течи становится ниже ожидаемой. Нужно учитывать все накопленные интервалы за кадр.
💡 Предлагаемое исправление
- comp.LeakAccumulator += frameTime;
- if (comp.LeakAccumulator < LeakInterval)
- continue;
-
- comp.LeakAccumulator -= LeakInterval;
-
- var leakAmount = comp.LeakRatePerHole * comp.LeakCount;
+ comp.LeakAccumulator += frameTime;
+ var intervals = (int)(comp.LeakAccumulator / LeakInterval);
+ if (intervals <= 0)
+ continue;
+
+ comp.LeakAccumulator -= intervals * LeakInterval;
+
+ var leakAmount = comp.LeakRatePerHole * comp.LeakCount * intervals;🤖 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.Server/Chemistry/EntitySystems/TankLeakSystem.cs` around lines 67 -
74, The leak interval processing in TankLeakSystem.cs currently only handles one
leak tick per frame update, causing the actual leak rate to be lower than
expected when frameTime is large. Replace the single if check for
comp.LeakAccumulator < LeakInterval with a while loop that continues to process
and subtract LeakInterval from comp.LeakAccumulator for each accumulated
interval, ensuring that all accumulated leak intervals within a single frame are
properly accounted for in the leakAmount calculation.
Пофикшен баг с балансом и пересадкой мозга. Добавлена система пулевых отверстий в хранилищах топлива и тд
Summary by CodeRabbit
Новые возможности
Изменения
Документация