boobs trap - #1145
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
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)
WalkthroughДобавлены компонент и серверная система для триггера предметов из слотов, а также обновлены прототипы ловушки-гранаты и граф крафта под новый слот-ориентированный сценарий срабатывания. ChangesGrenade trap trigger flow
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ 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)
Resources/Prototypes/_White/Recipes/Crafting/traps.yml (1)
19-55:⚠️ Potential issue | 🟠 Major | ⚡ Quick winПосле удаления
trap_grenadeосталась ссылка на несуществующий node.В этом графе больше нет узла
trap_grenade, но вResources/Prototypes/_White/Entities/Structures/Other/traps.ymlуGrenadeTrapGrenadeна Line [47] всё ещёnode: trap_grenade. Это кросс-файловой контрактный разрыв: прототип может сломаться при спавне/инициализации.Нужно либо удалить/перепривязать
GrenadeTrapGrenade, либо вернуть совместимый узел в граф.🤖 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 `@Resources/Prototypes/_White/Recipes/Crafting/traps.yml` around lines 19 - 55, The construction graph GrenadeTrapGraph still references nodes trap_poles and trap_full but the external prototype GrenadeTrapGrenade still targets a removed node named trap_grenade; fix by either restoring a compatible node named trap_grenade inside GrenadeTrapGraph (e.g., add a node with node: trap_grenade that routes correctly to trap_poles/trap_full and sets any required entity), or update the GrenadeTrapGrenade prototype to point to an existing node (trap_poles or trap_full) or remove its node entry entirely so there is no reference to trap_grenade; ensure the change maintains spawn/initialization semantics for GrenadeTrapGrenade and keep references to GrenadeTrapGraph and GrenadeTrapGrenade consistent.
🧹 Nitpick comments (1)
Resources/Prototypes/_White/Entities/Structures/Other/traps.yml (1)
26-32: ⚡ Quick winДобавьте ограничение вставки для
grenade_slot.На Line [26]-[32] слот без фильтра, поэтому принимает любой предмет. Если цель изменений — “все гранаты/активируемые”, лучше ограничить вставку по общему тегу/компоненту, чтобы не получить универсальный storage с принудительным eject по шагу.
🤖 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 `@Resources/Prototypes/_White/Entities/Structures/Other/traps.yml` around lines 26 - 32, Слот grenade_slot в блоке ItemSlots не имеет фильтра вставки и потому принимает любые предметы; добавьте ограничение вставки для grenade_slot (в секции ItemSlots) чтобы пропускать только подходящие объекты — например по общему тегу (tag: "grenade") или по наличии компонента/флага (например "activatable"/"explosive"), сохранив привязку TriggerItemSlot к тому же имени слота; обновите ключ фильтра (например insert_filter/allowed_tags/required_components в вашей схеме) для функции grenade_slot, чтобы не допустить универсального хранения с принудительным eject.
🤖 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/_White/Trigger/TriggerItemSlotSystem.cs`:
- Around line 37-43: The current flow bypasses ItemSlotsSystem when
_itemSlots.TryEjectToHands(uid, slot, null) returns false: do not call
_xform.AttachToGridOrMap(containedItem) or _trigger.Trigger(containedItem,
args.User) after a failed eject; instead return/abort so the slot system retains
control (or call the appropriate ItemSlotsSystem API for a world-eject if that’s
intended). Ensure the code checks the boolean result of TryEjectToHands and only
proceeds to AttachToGridOrMap and Trigger when eject succeeded, referencing
_itemSlots.TryEjectToHands, _xform.AttachToGridOrMap, _trigger.Trigger,
containedItem and args.User.
---
Outside diff comments:
In `@Resources/Prototypes/_White/Recipes/Crafting/traps.yml`:
- Around line 19-55: The construction graph GrenadeTrapGraph still references
nodes trap_poles and trap_full but the external prototype GrenadeTrapGrenade
still targets a removed node named trap_grenade; fix by either restoring a
compatible node named trap_grenade inside GrenadeTrapGraph (e.g., add a node
with node: trap_grenade that routes correctly to trap_poles/trap_full and sets
any required entity), or update the GrenadeTrapGrenade prototype to point to an
existing node (trap_poles or trap_full) or remove its node entry entirely so
there is no reference to trap_grenade; ensure the change maintains
spawn/initialization semantics for GrenadeTrapGrenade and keep references to
GrenadeTrapGraph and GrenadeTrapGrenade consistent.
---
Nitpick comments:
In `@Resources/Prototypes/_White/Entities/Structures/Other/traps.yml`:
- Around line 26-32: Слот grenade_slot в блоке ItemSlots не имеет фильтра
вставки и потому принимает любые предметы; добавьте ограничение вставки для
grenade_slot (в секции ItemSlots) чтобы пропускать только подходящие объекты —
например по общему тегу (tag: "grenade") или по наличии компонента/флага
(например "activatable"/"explosive"), сохранив привязку TriggerItemSlot к тому
же имени слота; обновите ключ фильтра (например
insert_filter/allowed_tags/required_components в вашей схеме) для функции
grenade_slot, чтобы не допустить универсального хранения с принудительным eject.
🪄 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: 03d4c93a-044a-40f5-8f93-5fc2f6939dab
📒 Files selected for processing (4)
Content.Server/_White/Trigger/TriggerItemSlotSystem.csContent.Shared/_White/Trigger/TriggerItemSlotComponent.csResources/Prototypes/_White/Entities/Structures/Other/traps.ymlResources/Prototypes/_White/Recipes/Crafting/traps.yml
| if (!_itemSlots.TryEjectToHands(uid, slot, null)) | ||
| { | ||
| _xform.AttachToGridOrMap(containedItem); | ||
| } | ||
|
|
||
| _trigger.Trigger(containedItem, args.User); | ||
| } |
There was a problem hiding this comment.
Не обходите ItemSlotsSystem при неудачном eject.
На Line [37] TryEjectToHands может вернуть false (например, locked slot), но на Line [39] выполняется прямой AttachToGridOrMap, а на Line [42] предмет всё равно триггерится. Это ломает контракт slot API и может оставить контейнер/слот в неконсистентном состоянии.
💡 Предлагаемое исправление
- if (slot.Item is EntityUid containedItem)
- {
- if (!_itemSlots.TryEjectToHands(uid, slot, null))
- {
- _xform.AttachToGridOrMap(containedItem);
- }
-
- _trigger.Trigger(containedItem, args.User);
- }
+ if (slot.Item is not EntityUid containedItem)
+ continue;
+
+ if (!_itemSlots.TryEject(uid, slot, null, out var ejected))
+ continue;
+
+ _trigger.Trigger(ejected.Value, args.User);🤖 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/_White/Trigger/TriggerItemSlotSystem.cs` around lines 37 - 43,
The current flow bypasses ItemSlotsSystem when _itemSlots.TryEjectToHands(uid,
slot, null) returns false: do not call _xform.AttachToGridOrMap(containedItem)
or _trigger.Trigger(containedItem, args.User) after a failed eject; instead
return/abort so the slot system retains control (or call the appropriate
ItemSlotsSystem API for a world-eject if that’s intended). Ensure the code
checks the boolean result of TryEjectToHands and only proceeds to
AttachToGridOrMap and Trigger when eject succeeded, referencing
_itemSlots.TryEjectToHands, _xform.AttachToGridOrMap, _trigger.Trigger,
containedItem and args.User.
This reverts commit 1674f9d.
| if (!_itemSlots.TryEjectToHands(uid, slot, null)) | ||
| { | ||
| _xform.AttachToGridOrMap(containedItem); | ||
| } |
There was a problem hiding this comment.
почему предмет сначала выбрасывается перед активацией?
There was a problem hiding this comment.
гранаты типа сингулярности ломаются когда не выбрасываются
There was a problem hiding this comment.
как будто отличный повод починить эти самые гранаты
|
тест проёбан навесь недостающий компонент на контейнер и убедись, что нужные контейнеры в нём заранее указаны |
Описание PR
растяжка с гранатой принимает любые штуки которые можно активировать, ну тоесть все гранаты
Медиа
Список
Изменения
🆑