Some fixes, tweaks, adds and removes.#1122
Some fixes, tweaks, adds and removes.#1122Lachklen wants to merge 15 commits intoWWhiteDreamProject:masterfrom
Conversation
…to create an anomaly.
…. Shitcode, but it works, so...
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughВнесены изменения в физику столкновений и телепортации, добавлена система урона при ударных столкновениях, исправления рендеринга/масштабирования, правки взаимодействий/FTL-кликов, очистка UI при отключении, а также обновления прототипов, миграций и локализаций. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Suggested labels
Suggested reviewers
🚥 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: 10
🧹 Nitpick comments (6)
Content.Server/GameTicking/GameTicker.Player.cs (1)
128-134: Стиль: добавьте фигурные скобки и поправьте отступы во вложенныхforeach.Логика корректна (снимок через
ToArray()защищает от модификацииOpenInterfacesвнутриCloseUi), ноifбез фигурных скобок с двумя вложеннымиforeachна одном уровне отступа с условием затрудняет чтение и повышает риск ошибок при будущих правках. Рекомендую обернуть в{ ... }и нормализовать отступы.♻️ Предлагаемая правка
// WWDP EDIT START - if ((mind.CurrentEntity != null && !Deleted(mind.CurrentEntity)) - && (TryComp<UserInterfaceUserComponent>(mind.CurrentEntity, out var userUi))) - foreach (var (targetEntity, keys) in userUi.OpenInterfaces.ToArray()) - foreach (var key in keys.ToArray()) - _ui.CloseUi(targetEntity, key, mind.CurrentEntity.Value); + if (mind.CurrentEntity != null + && !Deleted(mind.CurrentEntity) + && TryComp<UserInterfaceUserComponent>(mind.CurrentEntity, out var userUi)) + { + foreach (var (targetEntity, keys) in userUi.OpenInterfaces.ToArray()) + { + foreach (var key in keys.ToArray()) + _ui.CloseUi(targetEntity, key, mind.CurrentEntity.Value); + } + } // WWDP EDIT END🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Content.Server/GameTicking/GameTicker.Player.cs` around lines 128 - 134, The if block around the UI-close logic lacks braces and has misleading indentation for the two nested foreach loops; update the block that checks mind.CurrentEntity and TryComp<UserInterfaceUserComponent> to use explicit braces { ... } and re-indent the inner foreach loops so they are clearly nested inside the if, keeping the existing ToArray() calls on userUi.OpenInterfaces and keys and still calling _ui.CloseUi(targetEntity, key, mind.CurrentEntity.Value); reference the mind.CurrentEntity check, Deleted(mind.CurrentEntity), TryComp<UserInterfaceUserComponent>(mind.CurrentEntity, out var userUi), userUi.OpenInterfaces.ToArray(), keys.ToArray(), and _ui.CloseUi when making the change.Resources/Prototypes/InventoryTemplates/arachnid_inventory_template.yml (1)
56-65: Необязательная чистка: удалить закомментированный блок.Старое определение
suitstorageоставлено как закомментированный блок в WWDP EDIT. Поскольку рабочее определение теперь находится ниже (строки 142–152) и отличается (slotGroup: MainHotbar,dependsOnComponents), закомментированный блок вводит читателя в заблуждение и со временем разойдётся с актуальной версией. Можно удалить его полностью, сохранив только маркеры# WWDP EDITпри необходимости для merge-трассировки апстрима.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Resources/Prototypes/InventoryTemplates/arachnid_inventory_template.yml` around lines 56 - 65, Удалите весь закомментированный блок между маркерами "# WWDP EDIT START" и "# WWDP EDIT END", содержащий старое определение suitstorage (поля: name/suitstorage, slotTexture, slotFlags, stripTime, uiWindowPos, strippingWindowPos, dependsOn, displayName), чтобы не вводить в заблуждение; оставьте при необходимости только сами маркеры WWDP для трассировки, поскольку актуальная конфигурация suitstorage реализована ниже и использует другие поля (например slotGroup: MainHotbar и dependsOnComponents).Content.Server/Weapons/Melee/MeleeWeaponSystem.cs (1)
246-264: Мелкие замечания по рейкасту.
returnOnFirstHit: trueуже гарантирует максимум одно попадание —foreach ... breakможно заменить наresults.FirstOrDefault()или.Any()/.First()для наглядности.- Рейкаст стартует из
targetPos, и ignoredEnt =target, что корректно. Но еслиtargetна границе стены (AABB слегка внутри неё),wallDistбудет ~0, и хотяthrowSpeedне используется,pushVector = pushDir * wallDistпревратит толчок в no-op. Стоит как минимум гарантировать минимум (например,MathF.Max(wallDist - epsilon, 0f)), либо вообще не менятьpushVector, еслиwallDist < epsilon.CollisionGroup.Impassableне включаетBulletImpassableи прочее — толкать «сквозь» стеклянные окна/заборы будет нельзя только если они вImpassable. Проверьте, что все нужные стены действительно имеют этот слой.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Content.Server/Weapons/Melee/MeleeWeaponSystem.cs` around lines 246 - 264, Replace the foreach+break over results from _physics.IntersectRay with a single-result check (e.g. results.FirstOrDefault() or results.First()/Any()) to make intent explicit; when handling the hit, guard against tiny wallDist by using an epsilon (e.g. var effectiveDist = MathF.Max(wallDist - epsilon, 0f)) and only set pushVector = pushDir * effectiveDist (or skip updating pushVector if effectiveDist <= epsilon) and clamp throwSpeed similarly; keep the existing assignment to EnsureComp<ShoveImpactComponent>(target).OriginalSpeed when originalSpeed > throwSpeed, and also review that the CollisionGroup passed to IntersectRay (CollisionGroup.Impassable) actually includes all surfaces you expect (or add/include BulletImpassable/other groups) so glass/fences are detected.Content.Shared/Interaction/SharedInteractionSystem.cs (1)
871-881: Избыточная проверка!_itemQuery.HasComp(target)и потенциальное расширение игнор-листа.Поскольку это
else ifпосле ветки items (строка 848), проверка!_itemQuery.HasComp(target)здесь излишня — в эту ветку никогда не попадёт сущность сItemComponent. Можно упростить условие.Кроме того,
GetEntitiesIntersectingBody(target, collisionMask, …)вернёт все пересекающиеся сущности, включая мобов/игроков, которые стоят вплотную к структуре, и все они попадут в игнор-сет. Это намеренный эффект для фикса (несколькоFleshBlocker/RockBlockerна одном тайле), но стоит убедиться, что лучи к одной структуре не начнут «просвечивать» сквозь соседние мобы/предметы, стоящие на том же тайле и пересекающиеся с её AABB. Если это нежелательно — стоит фильтровать результат по_physicsQuery.HasComp + CanCollide + anchoredлибо ограничиться только закреплёнными структурами.♻️ Небольшая чистка условия
- else if (!_itemQuery.HasComp(target) && _physicsQuery.TryComp(target, out var physics2) && physics2.CanCollide) + else if (_physicsQuery.TryComp(target, out var physics2) && physics2.CanCollide)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Content.Shared/Interaction/SharedInteractionSystem.cs` around lines 871 - 881, Условие содержит избыточную проверку !_itemQuery.HasComp(target) и может добавлять в ignored все пересекающиеся сущности (включая мобы/игроков); уберите проверку !_itemQuery.HasComp(target) в ветке с _physicsQuery.TryComp(target, out var physics2) и вместо прямого ignored.UnionWith(_broadphase.GetEntitiesIntersectingBody(...)) фильтруйте результат вызова GetEntitiesIntersectingBody по желаемым компонентам/свойствам (например, для каждого e проверять _physicsQuery.TryComp(e,out var p) && p.CanCollide && p.Anchored или иные критерии), затем добавляйте в ignored только отфильтрованные сущности; обратитесь к символам _physicsQuery.TryComp, _broadphase.GetEntitiesIntersectingBody и ignored.UnionWith при внесении правок.Content.Shared/_White/Shove/ShoveImpactComponent.cs (1)
9-17: ПолеOriginalSpeedне реплицируется, хотя компонент[NetworkedComponent].У класса отсутствует
[AutoGenerateComponentState], а уOriginalSpeed—[AutoNetworkedField], поэтому значение не будет синхронизироваться с клиентом. СистемаShoveImpactSystemживёт вContent.Server, так что функционально это сейчас не ломается, но наличие[NetworkedComponent]без синхронизированных полей вводит в заблуждение и приведёт к рассинхрону, если поле начнут читать на клиенте. Либо добавьте авто-сеть, либо уберите[NetworkedComponent].♻️ Предлагаемый фикс
-[RegisterComponent, NetworkedComponent] +[RegisterComponent, NetworkedComponent, AutoGenerateComponentState] public sealed partial class ShoveImpactComponent : Component { /// <summary> /// The original throw speed before raycast capping. /// </summary> - [DataField] + [DataField, AutoNetworkedField] public float OriginalSpeed; }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Content.Shared/_White/Shove/ShoveImpactComponent.cs` around lines 9 - 17, Класс ShoveImpactComponent помечён [NetworkedComponent], но поле OriginalSpeed не реплицируется — добавьте либо автогенерацию состояния и пометите поле для сетки, либо уберите сетевой маркер: в ShoveImpactComponent либо добавить атрибут [AutoGenerateComponentState] на класс и отметить поле OriginalSpeed атрибутом [AutoNetworkedField], либо удалить [NetworkedComponent] с класса (учитывая, что ShoveImpactSystem живёт в Content.Server) — выберите подходящий вариант и приведи соответствующие атрибуты в一致ие.Content.Shared/Teleportation/Systems/SharedPortalSystem.cs (1)
224-252: Дублирование логики импакта при телепорте сWhitePortalSystem.Блоки 224–252 здесь и 61–86 в
Content.Shared/_White/Teleportation/Systems/WhitePortalSystem.cs— практически идентичная логика (захват скорости → расчёт relativeSpeed → урон/стан → занулениеLinearVelocity), но с разными коэффициентами урона (5f * (2f * relativeSpeed / 20f)vs5f * (relativeSpeed / 20f)). Это классический копипаст, который будет рассинхронизировываться при дальнейших правках. Разумно вынести в общий helper, напримерprotected void ApplyTeleportImpact(EntityUid subject, Vector2 oldMapVelocity)вSharedPortalSystemи использовать его из обоих мест, либо просто сделатьpublic static/extension.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Content.Shared/Teleportation/Systems/SharedPortalSystem.cs` around lines 224 - 252, Extract the duplicate teleport-impact logic into a single helper on SharedPortalSystem named ApplyTeleportImpact(EntityUid subject, Vector2 oldMapVelocity, float damageMultiplier = 1f) that encapsulates computing newGridVelocity, relativeSpeed, applying DamageSpecifier and stun, and zeroing LinearVelocity via _physics; keep the behavior configurable by damageMultiplier so callers can preserve original formulas (pass 1f from SharedPortalSystem and 0.5f from WhitePortalSystem to reproduce the two existing coefficients), then replace the duplicated blocks in SharedPortalSystem (the block using oldMapVelocity, _damageable, _stun and _physics.SetLinearVelocity) and in WhitePortalSystem with calls to ApplyTeleportImpact(subject, oldMapVelocity, <appropriate multiplier>).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@Content.Client/_White/Hands/DropOverlay.cs`:
- Around line 64-76: Calculate neededSize using both axes of
_eye.CurrentEye.Zoom (e.g., use Math.Min(1f, Math.Min(_eye.CurrentEye.Zoom.X,
_eye.CurrentEye.Zoom.Y))) instead of only Zoom.X, and clamp that result to a
sensible max to prevent unlimited growth; then only recreate/dispose
_renderBackbuffer via _renderBackbuffer.Dispose() +
_clyde.CreateRenderTarget(...) when the required size meaningfully differs
(larger or smaller) from _renderBackbuffer.Size to allow shrinking as well as
growth; update the condition around neededSize, the value passed to
CreateRenderTarget, and the logic that decides when to recreate before calling
handle.RenderInRenderTarget(...) / handle.DrawEntity(...).
In `@Content.Server/_White/Shove/ShoveImpactSystem.cs`:
- Around line 1-33: The ShoveImpactSystem class is declared in the global
namespace and an unused using (Content.Shared.Stunnable) remains; wrap the class
in the correct namespace Content.Server._White.Shove and remove the unused using
to follow project conventions and avoid type conflicts — locate the
ShoveImpactSystem declaration (and related ShoveImpactComponent usage) and add
the namespace declaration around the class, then delete the unused using
directive for Content.Shared.Stunnable.
- Around line 16-32: В методе OnCollide для ShoveImpactComponent замените
текущую общую проверки жесткости (args.OtherFixture.Hard) на проверку маски
столкновения аналогично PhysicalShove (проверять принадлежность к
CollisionGroup.Impassable, а не к MobMask), чтобы учитывать только
стены/непроходимые объекты; также исправьте вычисление effectiveSpeed: вместо
MathF.Max(originalSpeed, args.OurBody.LinearVelocity.Length()) используйте либо
MathF.Min(originalSpeed, args.OurBody.LinearVelocity.Length()) либо напрямую
args.OurBody.LinearVelocity.Length() (в зависимости от желаемой семантики),
чтобы учитывать снижение скорости после TryThrow и не всегда брать оригинальную
скорость.
In `@Content.Server/DeltaV/ParadoxAnomaly/Systems/ParadoxAnomalySystem.cs`:
- Around line 56-59: The failure popup currently always shows the hardcoded
"paradox-anomaly-create-false" message in ParadoxAnomalySystem.PopupCursor even
though TrySpawnParadoxAnomaly can fail for multiple reasons (e.g. no candidates
vs no latejoin spawn points). Either make the popup neutral (e.g. a generic
"could not create anomaly" message) or change TrySpawnParadoxAnomaly to
return/emit a failure reason (e.g. return a (bool success, string reason) or an
out parameter) and use that reason when calling _popup.PopupCursor instead of
the fixed Loc.GetString("paradox-anomaly-create-false"); update the call site
where TrySpawnParadoxAnomaly is invoked and the PopupCursor invocation to
display the specific reason string or the neutral fallback.
In `@Content.Server/Weapons/Melee/MeleeWeaponSystem.cs`:
- Around line 237-267: The local throwSpeed is computed and clamped by raycast
results but never used when calling _throwing.TryThrow; either remove
throwSpeed/originalSpeed if you only want to limit distance via pushVector, or
actually pass the clamped throwSpeed into TryThrow instead of force *
shovespeed. To apply the speed cap: use the computed throwSpeed as the speed
argument to _throwing.TryThrow(target, pushVector, throwSpeed, user, animated:
animated, throwInAir: throwInAir) and keep the
EnsureComp<ShoveImpactComponent>(target).OriginalSpeed = originalSpeed
assignment so the original un-clamped speed is recorded; otherwise delete
throwSpeed and originalSpeed and the related math (including their use in
EnsureComp) to remove dead code.
In `@Content.Shared/_White/Teleportation/Systems/WhitePortalSystem.cs`:
- Around line 61-86: The damage formula in WhitePortalSystem.cs currently uses
damage.DamageDict.Add("Blunt", 5f * (relativeSpeed / 20f)) which diverges from
SharedPortalSystem.cs where the calculation is 5f * (2f * relativeSpeed / 20f);
update WhitePortalSystem.cs to use the same expression (e.g.,
damage.DamageDict.Add("Blunt", 5f * (2f * relativeSpeed / 20f))) so the blunt
damage calculation matches SharedPortalSystem, or if the difference is
intentional, add a concise comment next to the DamageSpecifier creation
explaining why WhitePortalSystem uses a different coefficient; locate the change
around the relativeSpeed calculation and the block that constructs
DamageSpecifier / DamageDict and adjust accordingly.
In `@Content.Shared/Slippery/SlipperySystem.cs`:
- Around line 129-132: The current hard cap maxSlipSpeed (15f) clamps all
LaunchForwardsMultiplier effects; update the system to read a configurable cap
from SlipperyComponent (e.g., add a nullable float property like MaxLaunchSpeed)
and use that value instead of the local const in the calculation in
SlipperySystem (where newVelocity is computed using LaunchForwardsMultiplier),
falling back to the old default (15f) when null; ensure
SuperSlippery/admin-smite paths (e.g., AdminVerbSystem.Smites.cs usage of
LaunchForwardsMultiplier) can set a higher cap or null to disable the limit.
In `@Content.Shared/Teleportation/Systems/SharedPortalSystem.cs`:
- Line 250: The unconditional zeroing of velocity via
_physics.SetLinearVelocity(subject, Vector2.Zero, body: body) should be
restricted: only reset velocity when the computed relativeSpeed >= 20f or when
the entity is being transferred between maps; update the logic around where
relativeSpeed is calculated (reference relativeSpeed) and where
SetLinearVelocity is called (reference _physics.SetLinearVelocity(subject,
Vector2.Zero, body: body) and subject/body) so that for low-speed teleports you
preserve the existing velocity/impulse and only clear it for high-impact
teleports or cross-map transfers.
In
`@Resources/Locale/en-US/_white/paradoxanomaly/systems/paradoxanomalysystem.ftl`:
- Line 2: Fix the typo in the message string for the key
paradox-anomaly-create-false: replace "No candidats to create the paradox
anomaly." with "No candidates to create the paradox anomaly." so the value uses
the correct English word "candidates" (update the entry for
paradox-anomaly-create-false in the FTL file).
In `@Resources/Migrations/migration.yml`:
- Around line 501-504: Миграция обнуляет прототипы SalvageMagnet, SalvageLocator
и SalvageMagnetMachineCircuitboard, но связанные
рецепты/спаунеры/локеры/определения всё ещё создают или дают эти предметы;
удалите или отключите все упоминания чтобы полностью убрать контент:
удалите/закомментируйте рецепт CargoBotLathePack и рецепт
SalvageMagnetMachineCircuitboard (cargo.yml и electronics.yml),
удалите/отключите спаунер в techboard.yml, запись локера в heads.yml и
определение/запись платы в production.yml; альтернативно, если нужен обратимый
выключатель через CVar, не делать миграцию в null—вместо этого оставить
прототипы и добавить проверку CVar в коде/спаунерах/рецептах (или добавить
миграцию, которая удаляет рецепты/спаунеры при выключении), чтобы поведение было
консистентным.
---
Nitpick comments:
In `@Content.Server/GameTicking/GameTicker.Player.cs`:
- Around line 128-134: The if block around the UI-close logic lacks braces and
has misleading indentation for the two nested foreach loops; update the block
that checks mind.CurrentEntity and TryComp<UserInterfaceUserComponent> to use
explicit braces { ... } and re-indent the inner foreach loops so they are
clearly nested inside the if, keeping the existing ToArray() calls on
userUi.OpenInterfaces and keys and still calling _ui.CloseUi(targetEntity, key,
mind.CurrentEntity.Value); reference the mind.CurrentEntity check,
Deleted(mind.CurrentEntity),
TryComp<UserInterfaceUserComponent>(mind.CurrentEntity, out var userUi),
userUi.OpenInterfaces.ToArray(), keys.ToArray(), and _ui.CloseUi when making the
change.
In `@Content.Server/Weapons/Melee/MeleeWeaponSystem.cs`:
- Around line 246-264: Replace the foreach+break over results from
_physics.IntersectRay with a single-result check (e.g. results.FirstOrDefault()
or results.First()/Any()) to make intent explicit; when handling the hit, guard
against tiny wallDist by using an epsilon (e.g. var effectiveDist =
MathF.Max(wallDist - epsilon, 0f)) and only set pushVector = pushDir *
effectiveDist (or skip updating pushVector if effectiveDist <= epsilon) and
clamp throwSpeed similarly; keep the existing assignment to
EnsureComp<ShoveImpactComponent>(target).OriginalSpeed when originalSpeed >
throwSpeed, and also review that the CollisionGroup passed to IntersectRay
(CollisionGroup.Impassable) actually includes all surfaces you expect (or
add/include BulletImpassable/other groups) so glass/fences are detected.
In `@Content.Shared/_White/Shove/ShoveImpactComponent.cs`:
- Around line 9-17: Класс ShoveImpactComponent помечён [NetworkedComponent], но
поле OriginalSpeed не реплицируется — добавьте либо автогенерацию состояния и
пометите поле для сетки, либо уберите сетевой маркер: в ShoveImpactComponent
либо добавить атрибут [AutoGenerateComponentState] на класс и отметить поле
OriginalSpeed атрибутом [AutoNetworkedField], либо удалить [NetworkedComponent]
с класса (учитывая, что ShoveImpactSystem живёт в Content.Server) — выберите
подходящий вариант и приведи соответствующие атрибуты в一致ие.
In `@Content.Shared/Interaction/SharedInteractionSystem.cs`:
- Around line 871-881: Условие содержит избыточную проверку
!_itemQuery.HasComp(target) и может добавлять в ignored все пересекающиеся
сущности (включая мобы/игроков); уберите проверку !_itemQuery.HasComp(target) в
ветке с _physicsQuery.TryComp(target, out var physics2) и вместо прямого
ignored.UnionWith(_broadphase.GetEntitiesIntersectingBody(...)) фильтруйте
результат вызова GetEntitiesIntersectingBody по желаемым компонентам/свойствам
(например, для каждого e проверять _physicsQuery.TryComp(e,out var p) &&
p.CanCollide && p.Anchored или иные критерии), затем добавляйте в ignored только
отфильтрованные сущности; обратитесь к символам _physicsQuery.TryComp,
_broadphase.GetEntitiesIntersectingBody и ignored.UnionWith при внесении правок.
In `@Content.Shared/Teleportation/Systems/SharedPortalSystem.cs`:
- Around line 224-252: Extract the duplicate teleport-impact logic into a single
helper on SharedPortalSystem named ApplyTeleportImpact(EntityUid subject,
Vector2 oldMapVelocity, float damageMultiplier = 1f) that encapsulates computing
newGridVelocity, relativeSpeed, applying DamageSpecifier and stun, and zeroing
LinearVelocity via _physics; keep the behavior configurable by damageMultiplier
so callers can preserve original formulas (pass 1f from SharedPortalSystem and
0.5f from WhitePortalSystem to reproduce the two existing coefficients), then
replace the duplicated blocks in SharedPortalSystem (the block using
oldMapVelocity, _damageable, _stun and _physics.SetLinearVelocity) and in
WhitePortalSystem with calls to ApplyTeleportImpact(subject, oldMapVelocity,
<appropriate multiplier>).
In `@Resources/Prototypes/InventoryTemplates/arachnid_inventory_template.yml`:
- Around line 56-65: Удалите весь закомментированный блок между маркерами "#
WWDP EDIT START" и "# WWDP EDIT END", содержащий старое определение suitstorage
(поля: name/suitstorage, slotTexture, slotFlags, stripTime, uiWindowPos,
strippingWindowPos, dependsOn, displayName), чтобы не вводить в заблуждение;
оставьте при необходимости только сами маркеры WWDP для трассировки, поскольку
актуальная конфигурация suitstorage реализована ниже и использует другие поля
(например slotGroup: MainHotbar и dependsOnComponents).
🪄 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: 724ac76e-8286-4bfc-98bf-8e89b2864e8c
📒 Files selected for processing (20)
Content.Client/Shuttles/UI/ShuttleMapControl.xaml.csContent.Client/_White/Hands/DropOverlay.csContent.Server/DeltaV/ParadoxAnomaly/Systems/ParadoxAnomalySystem.csContent.Server/GameTicking/GameTicker.Player.csContent.Server/GameTicking/GameTicker.csContent.Server/Weapons/Melee/MeleeWeaponSystem.csContent.Server/_White/Shove/ShoveImpactSystem.csContent.Shared/Anomaly/SharedAnomalySystem.csContent.Shared/Interaction/SharedInteractionSystem.csContent.Shared/Slippery/SlipperySystem.csContent.Shared/Teleportation/Systems/SharedPortalSystem.csContent.Shared/_White/Shove/ShoveImpactComponent.csContent.Shared/_White/Teleportation/Systems/WhitePortalSystem.csResources/Locale/en-US/_white/paradoxanomaly/systems/paradoxanomalysystem.ftlResources/Locale/ru-RU/_white/paradoxanomaly/systems/paradoxanomalysystem.ftlResources/Migrations/migration.ymlResources/Prototypes/Entities/Mobs/NPCs/animals.ymlResources/Prototypes/Entities/Mobs/NPCs/space.ymlResources/Prototypes/InventoryTemplates/arachnid_inventory_template.ymlResources/Prototypes/_Goobstation/Devil/clauses.yml
|
Ебать, ярик, удивляешь |
|
Или это легкие фиксы? |
|
ХЗ |
|
Всё относительно |
|
Ладно, все равно молодец |
|
Чирикни ишуи, связанные с твоими фиксами, если такие есть |
There was a problem hiding this comment.
Actionable comments posted: 5
♻️ Duplicate comments (1)
Content.Client/_White/Hands/DropOverlay.cs (1)
64-79:⚠️ Potential issue | 🟠 MajorОграничьте render target практичным максимумом и используйте тот же безопасный zoom при отрисовке.
Line 64 при
Zoom = 0.01создаёт буфер12800x12800, что может резко ударить по VRAM/лимитам текстур. При этом Line 79 делит scale на сырой_eye.CurrentEye.Zoom, поэтому при zoom ниже выбранного floor размер спрайта продолжит расти уже несинхронно с размером буфера.Возможная правка
var adjustedAngle = dropcomp.Angle; - var neededSize = (int)(128 / Math.Min(1f, Math.Max(0.01f, Math.Min(_eye.CurrentEye.Zoom.X, _eye.CurrentEye.Zoom.Y)))); + const int baseRenderSize = 128; + const int maxRenderSize = 2048; + var minZoom = baseRenderSize / (float) maxRenderSize; + var zoom = _eye.CurrentEye.Zoom; + var safeZoom = new Vector2( + Math.Max(minZoom, zoom.X), + Math.Max(minZoom, zoom.Y)); + var neededSize = (int) Math.Ceiling(baseRenderSize / Math.Min(1f, Math.Min(safeZoom.X, safeZoom.Y))); if (_renderBackbuffer.Size.X < neededSize || _renderBackbuffer.Size.Y < neededSize || _renderBackbuffer.Size.X > neededSize * 2 || _renderBackbuffer.Size.Y > neededSize * 2) { @@ handle.RenderInRenderTarget(_renderBackbuffer, () => { - handle.DrawEntity(held, _renderBackbuffer.Size / 2, new Vector2(2.1f) / _eye.CurrentEye.Zoom, adjustedAngle); + handle.DrawEntity(held, _renderBackbuffer.Size / 2, new Vector2(2.1f) / safeZoom, adjustedAngle); }, Color.Transparent);🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Content.Client/_White/Hands/DropOverlay.cs` around lines 64 - 79, Compute a safe zoom and a capped render-target size instead of using the raw _eye.CurrentEye.Zoom to avoid huge textures: create a local safeZoom = Math.Min(1f, Math.Max(0.01f, Math.Min(_eye.CurrentEye.Zoom.X, _eye.CurrentEye.Zoom.Y))) (reuse the same clamped value for both axes) and compute neededSize from safeZoom, then clamp neededSize to a pragmatic MAX (e.g. 4096) before creating/disposing _renderBackbuffer via _clyde.CreateRenderTarget; finally, when calling handle.RenderInRenderTarget / handle.DrawEntity, use that same safeZoom (not _eye.CurrentEye.Zoom) to compute the scale vector so the sprite scale stays consistent with the buffer size.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@Content.Shared/_White/Teleportation/Systems/WhitePortalSystem.cs`:
- Around line 61-90: Сделайте общий helper (например ApplyPostTeleportProtection
or HandleTeleportPhysics) который берёт entity id, optional
PhysicsComponent/body и целевой transform/grid и выполняет: собрать
oldMapVelocity через _physics.GetMapLinearVelocity (используя
TryComp<PhysicsComponent> как сейчас), выполнить ту же post-teleport логику —
вычисление newGridVelocity (через Transform(...) и TryComp на gridBody),
вычисление relativeSpeed, нанесение урона через _damageable.TryChangeDamage и
парализа _stun.TryParalyze при HasComp<DamageableComponent>, и clamp скорости
через _physics.SetLinearVelocity; затем замените дублированный блок после
_transform.SetCoordinates и также вызовите этот helper после ветки случайной
телепортации, где сейчас вызывается SetMapCoordinates, чтобы обе ветки
использовали одинаковую защиту скорости.
- Around line 78-83: В блоке, где рассчитывается и применяется урон/паралич
(переменные relativeSpeed, args.OtherEntity) защитить вызовы
_damageable.TryChangeDamage и _stun.TryParalyze серверной проверкой сети: до
применения урона/стана проверить состояние сети (используя _net.IsClient или
противоположную серверную флаг-проверку) и выполнять изменение только на
сервере, чтобы предотвратить локальные клиентские вызовы; соответственно
переместить или обернуть вызовы TryChangeDamage и TryParalyze в условие, которое
пропускает выполнение на клиенте (например if (_net.IsClient) return; или if
(!_net.IsServer) return;).
- Around line 4-6: The file is missing the namespace import for
DamageableComponent: add "using Content.Shared.Damage.Components;" to the top of
WhitePortalSystem.cs alongside the other using statements so references to
DamageableComponent compile; ensure the new using is placed with the existing
imports (near the other Content.Shared.* usings) to resolve the symbol.
In `@Content.Shared/Teleportation/Systems/SharedPortalSystem.cs`:
- Around line 241-247: The damage and paralyze calls in TeleportEntity are being
run client-side; guard them so only the authoritative server mutates state: wrap
the _damageable.TryChangeDamage(subject, damage) and _stun.TryParalyze(subject,
...) calls in a server-only check (e.g. if (!IsServer) return; or the project’s
equivalent authority check) inside SharedPortalSystem.TeleportEntity so clients
only do prediction/visuals and the server applies DamageSpecifier and paralyze;
keep the relativeSpeed calculation client-side if needed but ensure
state-changing calls (_damageable.TryChangeDamage and _stun.TryParalyze) execute
only when the system has server authority.
- Line 10: Удалите дублирующий импорт: найдите повторяющуюся директиву using
Content.Shared.Projectiles (в файле с классом
SharedPortalSystem/SharedPortalSystem.cs) и удалите одну из них so чтобы каждая
using-директива присутствовала только один раз; проверьте, что больше нет
повторов и пересоберите чтобы убрать предупреждение CS0105.
---
Duplicate comments:
In `@Content.Client/_White/Hands/DropOverlay.cs`:
- Around line 64-79: Compute a safe zoom and a capped render-target size instead
of using the raw _eye.CurrentEye.Zoom to avoid huge textures: create a local
safeZoom = Math.Min(1f, Math.Max(0.01f, Math.Min(_eye.CurrentEye.Zoom.X,
_eye.CurrentEye.Zoom.Y))) (reuse the same clamped value for both axes) and
compute neededSize from safeZoom, then clamp neededSize to a pragmatic MAX (e.g.
4096) before creating/disposing _renderBackbuffer via _clyde.CreateRenderTarget;
finally, when calling handle.RenderInRenderTarget / handle.DrawEntity, use that
same safeZoom (not _eye.CurrentEye.Zoom) to compute the scale vector so the
sprite scale stays consistent with the buffer size.
🪄 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: c8d0e6fb-95a8-4839-b8f4-2896d4020e3d
📒 Files selected for processing (8)
Content.Client/Administration/UI/Tabs/AdminbusTab/AdminbusTab.xamlContent.Client/Administration/UI/Tabs/AdminbusTab/LoadBlueprintsWindow.xaml.csContent.Client/_White/Hands/DropOverlay.csContent.Server/_White/Shove/ShoveImpactSystem.csContent.Shared/Teleportation/Systems/SharedPortalSystem.csContent.Shared/_White/Teleportation/Systems/WhitePortalSystem.csResources/Locale/en-US/_white/paradoxanomaly/systems/paradoxanomalysystem.ftlResources/Locale/ru-RU/_white/paradoxanomaly/systems/paradoxanomalysystem.ftl
✅ Files skipped from review due to trivial changes (2)
- Resources/Locale/ru-RU/_white/paradoxanomaly/systems/paradoxanomalysystem.ftl
- Resources/Locale/en-US/_white/paradoxanomaly/systems/paradoxanomalysystem.ftl
🚧 Files skipped from review as they are similar to previous changes (1)
- Content.Server/_White/Shove/ShoveImpactSystem.cs
Описание PR
Несколько нужных багфиксов:
Изменения
🆑 Myaflic