-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
teleporter-WWDP #969
teleporter-WWDP #969
Conversation
ПроцессВ данном запросе на изменение добавлены новые компоненты и системы, связанные с механикой телепортации в игре. Введен класс Изменения
Стихотворение
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
RSI Diff Bot; head commit 862f596 merging into d3149cc Resources/Textures/Backmen/Objects/Devices/experimentalsyndicateteleporter.rsi
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🧹 Outside diff range and nitpick comments (4)
Resources/Prototypes/_Backmen/Entities/Objects/Devices/Syndicate_Gadgets/experimental_teleporter.yml (2)
5-5
: Исправьте грамматическую ошибку в описанииВ описании на строке 5 есть грамматическая ошибка: "Has 4 charge" следует заменить на "Has 4 charges".
Примените следующую правку:
- description: Syndicate teleporter, when used, moves 3-8 meters forward. In case of teleportation into a wall, uses emergency teleportation. Has 4 charge. + description: Syndicate teleporter, when used, moves 3-8 meters forward. In case of teleportation into a wall, uses emergency teleportation. Has 4 charges.
16-16
: Удалите лишние пробелы и добавьте пустую строку в конце файлаВ конце файла на строке 16 присутствуют лишние пробелы, и отсутствует новая строка. Это может вызвать проблемы при обработке файла.
Примените следующий дифф для исправления:
- rechargeDuration: 10 + rechargeDuration: 10 +🧰 Tools
🪛 yamllint (1.35.1)
[error] 16-16: no new line character at the end of file
(new-line-at-end-of-file)
[error] 16-16: trailing spaces
(trailing-spaces)
Resources/Prototypes/_Backmen/Entities/Effects/effects.yml (1)
1-20
: Структура эффектов реализована корректно!Компоненты эффектов телепортации хорошо организованы и логически связаны. Однако рекомендуется рассмотреть вынесение общих параметров (например, длительность эффекта) в отдельную конфигурацию для упрощения будущих изменений.
+ # TODO: Consider moving common parameters to a shared configuration - type: TimedDespawn lifetime: 0.6 # Could be defined in shared config
Also applies to: 21-39
Resources/Prototypes/_Backmen/Catalog/uplink_catalog.yml (1)
167-175
: Каталог аплинка дополнен корректно!Структура записи соответствует существующим стандартам каталога. Необходимо исправить отступы в категориях для соответствия стилю файла.
categories: - - UplinkUtility + - UplinkUtility🧰 Tools
🪛 yamllint (1.35.1)
[warning] 175-175: wrong indentation: expected 2 but found 4
(indentation)
[error] 175-175: no new line character at the end of file
(new-line-at-end-of-file)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
⛔ Files ignored due to path filters (6)
Resources/Audio/Backmen/Object/Devices/experimentalsyndicateteleport.ogg
is excluded by!**/*.ogg
Resources/Textures/Backmen/Objects/Devices/experimentalsyndicateteleporter.rsi/icon.png
is excluded by!**/*.png
Resources/Textures/Backmen/Objects/Devices/experimentalsyndicateteleporter.rsi/in.png
is excluded by!**/*.png
Resources/Textures/Backmen/Objects/Devices/experimentalsyndicateteleporter.rsi/inhand-left.png
is excluded by!**/*.png
Resources/Textures/Backmen/Objects/Devices/experimentalsyndicateteleporter.rsi/inhand-right.png
is excluded by!**/*.png
Resources/Textures/Backmen/Objects/Devices/experimentalsyndicateteleporter.rsi/out.png
is excluded by!**/*.png
📒 Files selected for processing (10)
Content.Server/Backmen/Teleporter/ExperimentalTeleporterComponent.cs
(1 hunks)Content.Server/Backmen/Teleporter/ExperimentalTeleporterSystem.cs
(1 hunks)Resources/Audio/Backmen/Object/Devices/attributions.yml
(1 hunks)Resources/Locale/en-US/_backmen/store/uplink-catalog.ftl
(1 hunks)Resources/Locale/ru-RU/_backmen/Entities/Objects/device/syndicate_gadgets/experimental-teleporter.ftl
(1 hunks)Resources/Locale/ru-RU/_backmen/store/uplink-catalog.ftl
(1 hunks)Resources/Prototypes/_Backmen/Catalog/uplink_catalog.yml
(1 hunks)Resources/Prototypes/_Backmen/Entities/Effects/effects.yml
(1 hunks)Resources/Prototypes/_Backmen/Entities/Objects/Devices/Syndicate_Gadgets/experimental_teleporter.yml
(1 hunks)Resources/Textures/Backmen/Objects/Devices/experimentalsyndicateteleporter.rsi/meta.json
(1 hunks)
✅ Files skipped from review due to trivial changes (2)
- Resources/Textures/Backmen/Objects/Devices/experimentalsyndicateteleporter.rsi/meta.json
- Resources/Locale/ru-RU/_backmen/Entities/Objects/device/syndicate_gadgets/experimental-teleporter.ftl
🧰 Additional context used
🪛 yamllint (1.35.1)
Resources/Prototypes/_Backmen/Entities/Objects/Devices/Syndicate_Gadgets/experimental_teleporter.yml
[error] 16-16: no new line character at the end of file
(new-line-at-end-of-file)
[error] 16-16: trailing spaces
(trailing-spaces)
Resources/Prototypes/_Backmen/Catalog/uplink_catalog.yml
[warning] 175-175: wrong indentation: expected 2 but found 4
(indentation)
[error] 175-175: no new line character at the end of file
(new-line-at-end-of-file)
Resources/Prototypes/_Backmen/Entities/Effects/effects.yml
[error] 39-39: no new line character at the end of file
(new-line-at-end-of-file)
Resources/Audio/Backmen/Object/Devices/attributions.yml
[error] 4-4: no new line character at the end of file
(new-line-at-end-of-file)
🪛 GitHub Check: build (ubuntu-latest)
Content.Server/Backmen/Teleporter/ExperimentalTeleporterSystem.cs
[failure] 28-28:
The type or namespace name 'LayingDownSystem' could not be found (are you missing a using directive or an assembly reference?)
[failure] 28-28:
The type or namespace name 'LayingDownSystem' could not be found (are you missing a using directive or an assembly reference?)
🪛 GitHub Check: YAML Linter
Content.Server/Backmen/Teleporter/ExperimentalTeleporterSystem.cs
[failure] 28-28:
The type or namespace name 'LayingDownSystem' could not be found (are you missing a using directive or an assembly reference?)
[failure] 28-28:
The type or namespace name 'LayingDownSystem' could not be found (are you missing a using directive or an assembly reference?)
🪛 GitHub Check: Test Packaging
Content.Server/Backmen/Teleporter/ExperimentalTeleporterSystem.cs
[failure] 28-28:
The type or namespace name 'LayingDownSystem' could not be found (are you missing a using directive or an assembly reference?)
[failure] 28-28:
The type or namespace name 'LayingDownSystem' could not be found (are you missing a using directive or an assembly reference?)
🔇 Additional comments (2)
Content.Server/Backmen/Teleporter/ExperimentalTeleporterComponent.cs (1)
1-28
: Код компонента корректен
Реализация ExperimentalTeleporterComponent
выглядит правильно и соответствует требованиям.
Resources/Locale/ru-RU/_backmen/store/uplink-catalog.ftl (1)
1-11
: Перевод локализации корректен
Все новые записи в файле локализации на русском языке правильны и соответствуют требованиям.
[Dependency] private readonly AudioSystem _audio = default!; | ||
[Dependency] private readonly ContainerSystem _containerSystem = default!; | ||
[Dependency] private readonly IRobustRandom _random = default!; | ||
[Dependency] private readonly LayingDownSystem _layingDown = default!; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ошибка: не найден тип или пространство имён 'LayingDownSystem'
На строке 28 используется тип LayingDownSystem
, но компилятор не может его найти. Вероятно, отсутствует соответствующая директива using
или ссылка на сборку.
Предлагаю добавить следующую директиву:
+ using Content.Server.Movement.Systems;
📝 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.
[Dependency] private readonly LayingDownSystem _layingDown = default!; | |
using Content.Server.Movement.Systems; | |
[Dependency] private readonly LayingDownSystem _layingDown = default!; |
🧰 Tools
🪛 GitHub Check: build (ubuntu-latest)
[failure] 28-28:
The type or namespace name 'LayingDownSystem' could not be found (are you missing a using directive or an assembly reference?)
[failure] 28-28:
The type or namespace name 'LayingDownSystem' could not be found (are you missing a using directive or an assembly reference?)
🪛 GitHub Check: YAML Linter
[failure] 28-28:
The type or namespace name 'LayingDownSystem' could not be found (are you missing a using directive or an assembly reference?)
[failure] 28-28:
The type or namespace name 'LayingDownSystem' could not be found (are you missing a using directive or an assembly reference?)
🪛 GitHub Check: Test Packaging
[failure] 28-28:
The type or namespace name 'LayingDownSystem' could not be found (are you missing a using directive or an assembly reference?)
[failure] 28-28:
The type or namespace name 'LayingDownSystem' could not be found (are you missing a using directive or an assembly reference?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⚠️ Potential issueОшибка: не найден тип или пространство имён 'LayingDownSystem'
На строке 28 используется тип
LayingDownSystem
, но компилятор не может его найти. Вероятно, отсутствует соответствующая директиваusing
или ссылка на сборку.Предлагаю добавить следующую директиву:
+ using Content.Server.Movement.Systems;
📝 Committable suggestion
🧰 Tools
using Content.Server.Backmen.Standing; ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@PvrG, да, вы правы. Если LayingDownSystem
находится в пространстве имён Content.Server.Backmen.Standing
, то добавление using Content.Server.Backmen.Standing;
должно решить проблему. Спасибо за уточнение!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@PvrG: Да, вы правы. Необходимо добавить директиву:
using Content.Server.Backmen.Standing;
Это подключит пространство имён, в котором определён LayingDownSystem
, и устранит ошибку компиляции.
🔗 Analysis chain
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Поиск определения класса LayingDownSystem и его пространства имён
rg -A 5 -B 5 'class LayingDownSystem'
Length of output: 2072
uplink-betrayal-knife-name = Experimental syndicate teleporter | ||
uplink-betrayal-knife-desc = Syndicate teleporter, when used, moves 3-8 meters forward. In case of teleportation into a wall, uses emergency teleportation. Has 4 charge. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Исправьте дублирующиеся ключи для локализации
Ключи uplink-betrayal-knife-name
и uplink-betrayal-knife-desc
на строках 7-8 дублируются с предыдущими записями и относятся к другому предмету. Это может привести к конфликтам в локализации.
Предлагаю изменить ключи на уникальные для экспериментального телепортера:
- uplink-betrayal-knife-name = Experimental syndicate teleporter
- uplink-betrayal-knife-desc = Syndicate teleporter, when used, moves 3-8 meters forward. In case of teleportation into a wall, uses emergency teleportation. Has 4 charge.
+ uplink-experimental-syndicate-teleporter-name = Experimental syndicate teleporter
+ uplink-experimental-syndicate-teleporter-desc = Syndicate teleporter, when used, moves 3-8 meters forward. In case of teleportation into a wall, uses emergency teleportation. Has 4 charges.
📝 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.
uplink-betrayal-knife-name = Experimental syndicate teleporter | |
uplink-betrayal-knife-desc = Syndicate teleporter, when used, moves 3-8 meters forward. In case of teleportation into a wall, uses emergency teleportation. Has 4 charge. | |
uplink-experimental-syndicate-teleporter-name = Experimental syndicate teleporter | |
uplink-experimental-syndicate-teleporter-desc = Syndicate teleporter, when used, moves 3-8 meters forward. In case of teleportation into a wall, uses emergency teleportation. Has 4 charges. |
- files: ["experimentalsyndicateteleport.ogg"] | ||
license: "CC-BY-NC-SA-4.0" | ||
copyright: "Taken from White Dream" | ||
source: "https://github.com/frosty-dev/ss14-core/blob/master/Resources/Audio/White/Devices/expsyndicateteleport.ogg" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
Источник звукового файла недоступен!
Ссылка на исходный файл возвращает ошибку 404, что указывает на его отсутствие в указанном репозитории. Необходимо:
- Обновить ссылку на актуальный источник файла
- Убедиться, что использование файла соответствует условиям лицензии CC-BY-NC-SA-4.0
- Рассмотреть возможность поиска файла в архивных версиях репозитория или связаться с авторами White Dream для получения корректной ссылки
🔗 Analysis chain
Проверить доступность источника звукового файла!
Атрибуция корректно указана, но необходимо убедиться в актуальности ссылки на исходный файл и соответствии условиям лицензии CC-BY-NC-SA-4.0.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify source file availability and license compliance
# Check if source URL is accessible
curl -I "https://github.com/frosty-dev/ss14-core/blob/master/Resources/Audio/White/Devices/expsyndicateteleport.ogg"
# Verify local file exists
fd "experimentalsyndicateteleport.ogg" Resources/Audio/Backmen/Object/Devices/
Length of output: 5069
🧰 Tools
🪛 yamllint (1.35.1)
[error] 4-4: no new line character at the end of file
(new-line-at-end-of-file)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
Content.Server/Backmen/Teleporter/ExperimentalTeleporterSystem.cs
(1 hunks)Resources/Locale/ru-RU/_backmen/store/uplink-catalog.ftl
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- Resources/Locale/ru-RU/_backmen/store/uplink-catalog.ftl
🧰 Additional context used
🪛 GitHub Check: YAML Linter
Content.Server/Backmen/Teleporter/ExperimentalTeleporterSystem.cs
[failure] 80-80:
'LayingDownSystem' does not contain a definition for 'LieDownInRange' and no accessible extension method 'LieDownInRange' accepting a first argument of type 'LayingDownSystem' could be found (are you missing a using directive or an assembly reference?)
[failure] 80-80:
'LayingDownSystem' does not contain a definition for 'LieDownInRange' and no accessible extension method 'LieDownInRange' accepting a first argument of type 'LayingDownSystem' could be found (are you missing a using directive or an assembly reference?)
🪛 GitHub Check: build (ubuntu-latest)
Content.Server/Backmen/Teleporter/ExperimentalTeleporterSystem.cs
[failure] 80-80:
'LayingDownSystem' does not contain a definition for 'LieDownInRange' and no accessible extension method 'LieDownInRange' accepting a first argument of type 'LayingDownSystem' could be found (are you missing a using directive or an assembly reference?)
[failure] 80-80:
'LayingDownSystem' does not contain a definition for 'LieDownInRange' and no accessible extension method 'LieDownInRange' accepting a first argument of type 'LayingDownSystem' could be found (are you missing a using directive or an assembly reference?)
🪛 GitHub Check: Test Packaging
Content.Server/Backmen/Teleporter/ExperimentalTeleporterSystem.cs
[failure] 80-80:
'LayingDownSystem' does not contain a definition for 'LieDownInRange' and no accessible extension method 'LieDownInRange' accepting a first argument of type 'LayingDownSystem' could be found (are you missing a using directive or an assembly reference?)
[failure] 80-80:
'LayingDownSystem' does not contain a definition for 'LieDownInRange' and no accessible extension method 'LieDownInRange' accepting a first argument of type 'LayingDownSystem' could be found (are you missing a using directive or an assembly reference?)
{ | ||
PlaySoundAndEffects(component, coords, oldCoords); | ||
|
||
_layingDown.LieDownInRange(uid, coords); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Исправьте ошибку: метод 'LieDownInRange' отсутствует в 'LayingDownSystem'
Статический анализ выявил, что метод LieDownInRange
не определён в LayingDownSystem
. Проверьте правильность вызова метода или замените его на существующий метод для укладывания персонажа.
🧰 Tools
🪛 GitHub Check: YAML Linter
[failure] 80-80:
'LayingDownSystem' does not contain a definition for 'LieDownInRange' and no accessible extension method 'LieDownInRange' accepting a first argument of type 'LayingDownSystem' could be found (are you missing a using directive or an assembly reference?)
[failure] 80-80:
'LayingDownSystem' does not contain a definition for 'LieDownInRange' and no accessible extension method 'LieDownInRange' accepting a first argument of type 'LayingDownSystem' could be found (are you missing a using directive or an assembly reference?)
🪛 GitHub Check: build (ubuntu-latest)
[failure] 80-80:
'LayingDownSystem' does not contain a definition for 'LieDownInRange' and no accessible extension method 'LieDownInRange' accepting a first argument of type 'LayingDownSystem' could be found (are you missing a using directive or an assembly reference?)
[failure] 80-80:
'LayingDownSystem' does not contain a definition for 'LieDownInRange' and no accessible extension method 'LieDownInRange' accepting a first argument of type 'LayingDownSystem' could be found (are you missing a using directive or an assembly reference?)
🪛 GitHub Check: Test Packaging
[failure] 80-80:
'LayingDownSystem' does not contain a definition for 'LieDownInRange' and no accessible extension method 'LieDownInRange' accepting a first argument of type 'LayingDownSystem' could be found (are you missing a using directive or an assembly reference?)
[failure] 80-80:
'LayingDownSystem' does not contain a definition for 'LieDownInRange' and no accessible extension method 'LieDownInRange' accepting a first argument of type 'LayingDownSystem' could be found (are you missing a using directive or an assembly reference?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 5
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
Content.Server/Backmen/Teleporter/ExperimentalTeleporterSystem.cs
(1 hunks)Content.Shared/Standing/SharedLayingDownSystem.cs
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- Content.Server/Backmen/Teleporter/ExperimentalTeleporterSystem.cs
🧰 Additional context used
🪛 GitHub Check: build (ubuntu-latest)
Content.Shared/Standing/SharedLayingDownSystem.cs
[failure] 92-92:
The type or namespace name 'ChangeLayingDownEvent' could not be found (are you missing a using directive or an assembly reference?)
[failure] 126-126:
The type or namespace name 'LayingDownComponent' could not be found (are you missing a using directive or an assembly reference?)
[failure] 137-137:
The type or namespace name 'LayingDownComponent' could not be found (are you missing a using directive or an assembly reference?)
[failure] 149-149:
The type or namespace name 'LayingDownComponent' could not be found (are you missing a using directive or an assembly reference?)
[failure] 176-176:
The type or namespace name 'LayingDownComponent' could not be found (are you missing a using directive or an assembly reference?)
[failure] 92-92:
The type or namespace name 'ChangeLayingDownEvent' could not be found (are you missing a using directive or an assembly reference?)
[failure] 126-126:
The type or namespace name 'LayingDownComponent' could not be found (are you missing a using directive or an assembly reference?)
[failure] 137-137:
The type or namespace name 'LayingDownComponent' could not be found (are you missing a using directive or an assembly reference?)
[failure] 149-149:
The type or namespace name 'LayingDownComponent' could not be found (are you missing a using directive or an assembly reference?)
🪛 GitHub Check: YAML Linter
Content.Shared/Standing/SharedLayingDownSystem.cs
[failure] 92-92:
The type or namespace name 'ChangeLayingDownEvent' could not be found (are you missing a using directive or an assembly reference?)
[failure] 126-126:
The type or namespace name 'LayingDownComponent' could not be found (are you missing a using directive or an assembly reference?)
[failure] 137-137:
The type or namespace name 'LayingDownComponent' could not be found (are you missing a using directive or an assembly reference?)
[failure] 149-149:
The type or namespace name 'LayingDownComponent' could not be found (are you missing a using directive or an assembly reference?)
[failure] 176-176:
The type or namespace name 'LayingDownComponent' could not be found (are you missing a using directive or an assembly reference?)
[failure] 92-92:
The type or namespace name 'ChangeLayingDownEvent' could not be found (are you missing a using directive or an assembly reference?)
[failure] 126-126:
The type or namespace name 'LayingDownComponent' could not be found (are you missing a using directive or an assembly reference?)
[failure] 137-137:
The type or namespace name 'LayingDownComponent' could not be found (are you missing a using directive or an assembly reference?)
[failure] 149-149:
The type or namespace name 'LayingDownComponent' could not be found (are you missing a using directive or an assembly reference?)
🪛 GitHub Check: Test Packaging
Content.Shared/Standing/SharedLayingDownSystem.cs
[failure] 92-92:
The type or namespace name 'ChangeLayingDownEvent' could not be found (are you missing a using directive or an assembly reference?)
[failure] 126-126:
The type or namespace name 'LayingDownComponent' could not be found (are you missing a using directive or an assembly reference?)
[failure] 137-137:
The type or namespace name 'LayingDownComponent' could not be found (are you missing a using directive or an assembly reference?)
[failure] 149-149:
The type or namespace name 'LayingDownComponent' could not be found (are you missing a using directive or an assembly reference?)
[failure] 176-176:
The type or namespace name 'LayingDownComponent' could not be found (are you missing a using directive or an assembly reference?)
[failure] 92-92:
The type or namespace name 'ChangeLayingDownEvent' could not be found (are you missing a using directive or an assembly reference?)
[failure] 126-126:
The type or namespace name 'LayingDownComponent' could not be found (are you missing a using directive or an assembly reference?)
[failure] 137-137:
The type or namespace name 'LayingDownComponent' could not be found (are you missing a using directive or an assembly reference?)
|| !HasComp<LayingDownComponent>(session.AttachedEntity) | ||
|| _gravity.IsWeightless(session.AttachedEntity.Value)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Добавьте определение или using-директиву для 'LayingDownComponent'
Тип LayingDownComponent
не найден во многих местах кода. Убедитесь, что этот тип определён в проекте и добавлена необходимая using
-директива для соответствующего пространства имён.
Примените следующий дифф для добавления using
-директивы:
+using Content.Shared.Standing.Components;
Also applies to: 72-74, 99-100, 126-127, 137-138, 149-150, 176-177
|
||
private void ToggleStanding(ICommonSession? session) | ||
{ | ||
if (session is not { AttachedEntity: { Valid: true } uid } _ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Исправьте синтаксическую ошибку в условии 'if'
В строке 58 в условии if
присутствует лишний символ _
в конце, что приводит к синтаксической ошибке. Удалите символ _
для корректной компиляции.
Примените следующий дифф для исправления:
-if (session is not { AttachedEntity: { Valid: true } uid } _
+if (session is not { AttachedEntity: { Valid: true } uid })
📝 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 (session is not { AttachedEntity: { Valid: true } uid } _ | |
if (session is not { AttachedEntity: { Valid: true } uid }) |
component.CurrentState = StandingState.Lying; | ||
|
||
component.CurrentState = StandingState.Standing; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Проверьте логическую ошибку при установке 'CurrentState'
В строке 120 устанавливается component.CurrentState = StandingState.Lying;
, а сразу после этого в строке 122 устанавливается component.CurrentState = StandingState.Standing;
. Это приводит к тому, что предыдущее значение перезаписывается. Убедитесь, что состояние устанавливается корректно и отсутствуют лишние присвоения.
Примените следующий дифф для исправления:
component.CurrentState = StandingState.Lying;
- component.CurrentState = StandingState.Standing;
📝 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.
component.CurrentState = StandingState.Lying; | |
component.CurrentState = StandingState.Standing; | |
} | |
component.CurrentState = StandingState.Lying; | |
} |
var ents = new HashSet<Entity<LayingDownComponent>>(); | ||
_lookup.GetEntitiesInRange(coords, range, ents); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Проверьте использование типа в коллекции 'ents'
Использование HashSet<Entity<LayingDownComponent>>
может быть некорректным. Возможно, следует использовать HashSet<EntityUid>
или другую подходящую коллекцию. Также убедитесь, что метод _lookup.GetEntitiesInRange
правильно заполняет коллекцию и типы совпадают.
Примените следующий дифф для исправления:
-public void LieDownInRange(EntityUid uid, EntityCoordinates coords, float range = 0.4f)
-{
- var ents = new HashSet<Entity<LayingDownComponent>>();
+public void LieDownInRange(EntityUid uid, EntityCoordinates coords, float range = 0.4f)
+{
+ var ents = new HashSet<EntityUid>();
Committable suggestion skipped: line range outside the PR's diff.
private void OnChangeState(ChangeLayingDownEvent ev, EntitySessionEventArgs args) | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Добавьте определение или using-директиву для 'ChangeLayingDownEvent'
Тип ChangeLayingDownEvent
не найден. Убедитесь, что этот тип определён в проекте и добавлена необходимая using
-директива для соответствующего пространства имён.
Примените следующий дифф для добавления using
-директивы:
+using Content.Shared.Standing;
Committable suggestion skipped: line range outside the PR's diff.
🧰 Tools
🪛 GitHub Check: build (ubuntu-latest)
[failure] 92-92:
The type or namespace name 'ChangeLayingDownEvent' could not be found (are you missing a using directive or an assembly reference?)
[failure] 92-92:
The type or namespace name 'ChangeLayingDownEvent' could not be found (are you missing a using directive or an assembly reference?)
🪛 GitHub Check: YAML Linter
[failure] 92-92:
The type or namespace name 'ChangeLayingDownEvent' could not be found (are you missing a using directive or an assembly reference?)
[failure] 92-92:
The type or namespace name 'ChangeLayingDownEvent' could not be found (are you missing a using directive or an assembly reference?)
🪛 GitHub Check: Test Packaging
[failure] 92-92:
The type or namespace name 'ChangeLayingDownEvent' could not be found (are you missing a using directive or an assembly reference?)
[failure] 92-92:
The type or namespace name 'ChangeLayingDownEvent' could not be found (are you missing a using directive or an assembly reference?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Outside diff range and nitpick comments (3)
Content.Server/Backmen/Teleporter/ExperimentalTeleporterSystem.cs (3)
96-105
: Оптимизируйте проверку стенМетод
TryCheckWall
выполняет избыточные операции:
- Получает все закреплённые сущности
- Проверяет тег "Wall" для каждой сущности
Рекомендуется использовать более эффективный метод проверки:
private bool TryCheckWall(EntityCoordinates coords) { if (!coords.TryGetTileRef(out var tile) || !TryComp<MapGridComponent>(tile.Value.GridUid, out var mapGridComponent)) return false; - var anchoredEntities = _mapSystem.GetAnchoredEntities(tile.Value.GridUid, mapGridComponent, coords); - return anchoredEntities.Any(x => _tag.HasTag(x, "Wall")); + return _mapSystem.GetAnchoredEntities(tile.Value.GridUid, mapGridComponent, coords) + .Any(x => _tag.HasTag(x, "Wall")); }
87-94
: Оптимизируйте воспроизведение звуков и эффектовМетод
PlaySoundAndEffects
дублирует вызовыPlayPvs
с одним и тем же звуком. Рекомендуется объединить логику воспроизведения звуков.private void PlaySoundAndEffects(ExperimentalTeleporterComponent component, EntityCoordinates coords, EntityCoordinates oldCoords) { - _audio.PlayPvs(component.TeleportSound, coords); - _audio.PlayPvs(component.TeleportSound, oldCoords); + var positions = new[] { coords, oldCoords }; + foreach (var position in positions) + { + _audio.PlayPvs(component.TeleportSound, position); + } _entManager.SpawnEntity(component.TeleportInEffect, coords); _entManager.SpawnEntity(component.TeleportOutEffect, oldCoords); }
107-114
: Добавьте проверку входных параметровВ методе
VectorRandomDirection
отсутствуют проверки входных параметров:
- Параметр
length
может быть отрицательным- Компонент может быть null
private Vector2 VectorRandomDirection(ExperimentalTeleporterComponent component, Vector2 offset, int length) { + if (component == null) + return Vector2.Zero; + + if (length < 0) + length = 0; + if (component.RandomRotations.Count == 0) return Vector2.Zero; var randomRotation = _random.Next(0, component.RandomRotations.Count); return Angle.FromDegrees(component.RandomRotations[randomRotation]).RotateVec(offset.Normalized() * length); }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
Content.Server/Backmen/Teleporter/ExperimentalTeleporterSystem.cs
(1 hunks)
🧰 Additional context used
🪛 GitHub Check: build (ubuntu-latest)
Content.Server/Backmen/Teleporter/ExperimentalTeleporterSystem.cs
[failure] 81-81:
'SharedLayingDownSystem' does not contain a definition for 'LieDownInRange' and no accessible extension method 'LieDownInRange' accepting a first argument of type 'SharedLayingDownSystem' could be found (are you missing a using directive or an assembly reference?)
[failure] 81-81:
'SharedLayingDownSystem' does not contain a definition for 'LieDownInRange' and no accessible extension method 'LieDownInRange' accepting a first argument of type 'SharedLayingDownSystem' could be found (are you missing a using directive or an assembly reference?)
🪛 GitHub Check: Test Packaging
Content.Server/Backmen/Teleporter/ExperimentalTeleporterSystem.cs
[failure] 81-81:
'SharedLayingDownSystem' does not contain a definition for 'LieDownInRange' and no accessible extension method 'LieDownInRange' accepting a first argument of type 'SharedLayingDownSystem' could be found (are you missing a using directive or an assembly reference?)
[failure] 81-81:
'SharedLayingDownSystem' does not contain a definition for 'LieDownInRange' and no accessible extension method 'LieDownInRange' accepting a first argument of type 'SharedLayingDownSystem' could be found (are you missing a using directive or an assembly reference?)
🪛 GitHub Check: YAML Linter
Content.Server/Backmen/Teleporter/ExperimentalTeleporterSystem.cs
[failure] 81-81:
'SharedLayingDownSystem' does not contain a definition for 'LieDownInRange' and no accessible extension method 'LieDownInRange' accepting a first argument of type 'SharedLayingDownSystem' could be found (are you missing a using directive or an assembly reference?)
[failure] 81-81:
'SharedLayingDownSystem' does not contain a definition for 'LieDownInRange' and no accessible extension method 'LieDownInRange' accepting a first argument of type 'SharedLayingDownSystem' could be found (are you missing a using directive or an assembly reference?)
🔇 Additional comments (1)
Content.Server/Backmen/Teleporter/ExperimentalTeleporterSystem.cs (1)
5-5
: Проверьте правильность пространства имён для системы LayingDown
Текущий импорт Content.Server.Standing
и использование SharedLayingDownSystem
может быть некорректным. Возможно, следует использовать Content.Server.Backmen.Standing
.
#!/bin/bash
# Поиск определения SharedLayingDownSystem
rg -l "class (Shared)?LayingDownSystem"
Also applies to: 29-29
private void OnUse(EntityUid uid, ExperimentalTeleporterComponent component, UseInHandEvent args) | ||
{ | ||
if (_charges.IsEmpty(uid) | ||
|| !TryComp<TransformComponent>(args.User, out var xform) | ||
|| (_containerSystem.IsEntityInContainer(args.User) | ||
&& !_containerSystem.TryRemoveFromContainer(args.User))) | ||
return; | ||
|
||
var oldCoords = xform.Coordinates; | ||
var range = _random.Next(component.MinTeleportRange, component.MaxTeleportRange); | ||
var offset = xform.LocalRotation.ToWorldVec().Normalized(); | ||
var direction = xform.LocalRotation.GetDir().ToVec(); | ||
var newOffset = offset + direction * range; | ||
|
||
var coords = xform.Coordinates.Offset(newOffset).SnapToGrid(EntityManager); | ||
|
||
Teleport(args.User, uid, component, coords, oldCoords); | ||
|
||
if (!TryCheckWall(coords) | ||
|| EmergencyTeleportation(args.User, uid, component, xform, oldCoords, newOffset)) | ||
return; | ||
|
||
_bodySystem.GibBody(args.User, true, splatModifier: 3F); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Добавьте дополнительные проверки безопасности
- Отсутствуют проверки на null для компонентов и зависимостей
- Нет обработки ошибок при неудачном телепортировании
- Жёсткое значение множителя разброса (3F) лучше вынести в константу
Предлагаю следующие изменения:
private void OnUse(EntityUid uid, ExperimentalTeleporterComponent component, UseInHandEvent args)
{
+ if (!Resolve(args.User, ref xform))
+ return;
+
if (_charges.IsEmpty(uid)
- || !TryComp<TransformComponent>(args.User, out var xform)
|| (_containerSystem.IsEntityInContainer(args.User)
&& !_containerSystem.TryRemoveFromContainer(args.User)))
return;
+ const float GibSplatModifier = 3f;
// ... rest of the method ...
- _bodySystem.GibBody(args.User, true, splatModifier: 3F);
+ _bodySystem.GibBody(args.User, true, splatModifier: GibSplatModifier);
}
Committable suggestion skipped: line range outside the PR's diff.
private bool EmergencyTeleportation(EntityUid uid, EntityUid teleporterUid, ExperimentalTeleporterComponent component, TransformComponent xform, EntityCoordinates oldCoords, Vector2 offset) | ||
{ | ||
var newOffset = offset + VectorRandomDirection(component, offset, component.EmergencyLength); | ||
var coords = xform.Coordinates.Offset(newOffset).SnapToGrid(EntityManager); | ||
|
||
if (_charges.IsEmpty(teleporterUid)) | ||
return false; | ||
|
||
Teleport(uid, teleporterUid, component, coords, oldCoords); | ||
|
||
return !TryCheckWall(coords); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Предотвратите возможность бесконечной рекурсии
Метод EmergencyTeleportation
может вызвать бесконечную рекурсию через Teleport
, который может снова вызвать EmergencyTeleportation
. Рекомендуется:
- Добавить максимальное количество попыток телепортации
- Передавать счётчик попыток через параметры
- Добавить проверку на максимальное количество попыток
Предлагаемые изменения:
+ private const int MaxEmergencyAttempts = 3;
- private bool EmergencyTeleportation(EntityUid uid, EntityUid teleporterUid, ExperimentalTeleporterComponent component, TransformComponent xform, EntityCoordinates oldCoords, Vector2 offset)
+ private bool EmergencyTeleportation(EntityUid uid, EntityUid teleporterUid, ExperimentalTeleporterComponent component, TransformComponent xform, EntityCoordinates oldCoords, Vector2 offset, int attempts = 0)
{
+ if (attempts >= MaxEmergencyAttempts)
+ return false;
+
var newOffset = offset + VectorRandomDirection(component, offset, component.EmergencyLength);
// ... rest of the method
}
Committable suggestion skipped: line range outside the PR's diff.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
Content.Shared/Backmen/Standing/SharedLayingDownSystem.cs
(1 hunks)
🧰 Additional context used
🪛 GitHub Check: build (ubuntu-latest)
Content.Shared/Backmen/Standing/SharedLayingDownSystem.cs
[failure] 361-361:
The type or namespace name 'EntityCoordinates' could not be found (are you missing a using directive or an assembly reference?)
[failure] 361-361:
The type or namespace name 'EntityCoordinates' could not be found (are you missing a using directive or an assembly reference?)
🪛 GitHub Check: YAML Linter
Content.Shared/Backmen/Standing/SharedLayingDownSystem.cs
[failure] 361-361:
The type or namespace name 'EntityCoordinates' could not be found (are you missing a using directive or an assembly reference?)
[failure] 361-361:
The type or namespace name 'EntityCoordinates' could not be found (are you missing a using directive or an assembly reference?)
🪛 GitHub Check: Test Packaging
Content.Shared/Backmen/Standing/SharedLayingDownSystem.cs
[failure] 361-361:
The type or namespace name 'EntityCoordinates' could not be found (are you missing a using directive or an assembly reference?)
[failure] 361-361:
The type or namespace name 'EntityCoordinates' could not be found (are you missing a using directive or an assembly reference?)
🔇 Additional comments (1)
Content.Shared/Backmen/Standing/SharedLayingDownSystem.cs (1)
Line range hint 372-377
: Хорошо структурированное перечисление!
Перечисление DropHeldItemsBehavior
имеет четкую семантику и правильно использует байтовый тип данных для оптимизации сериализации.
🧰 Tools
🪛 GitHub Check: build (ubuntu-latest)
[failure] 361-361:
The type or namespace name 'EntityCoordinates' could not be found (are you missing a using directive or an assembly reference?)
[failure] 361-361:
The type or namespace name 'EntityCoordinates' could not be found (are you missing a using directive or an assembly reference?)
🪛 GitHub Check: YAML Linter
[failure] 361-361:
The type or namespace name 'EntityCoordinates' could not be found (are you missing a using directive or an assembly reference?)
[failure] 361-361:
The type or namespace name 'EntityCoordinates' could not be found (are you missing a using directive or an assembly reference?)
🪛 GitHub Check: Test Packaging
[failure] 361-361:
The type or namespace name 'EntityCoordinates' could not be found (are you missing a using directive or an assembly reference?)
[failure] 361-361:
The type or namespace name 'EntityCoordinates' could not be found (are you missing a using directive or an assembly reference?)
// WWDP | ||
public void LieDownInRange(EntityUid uid, EntityCoordinates coords, float range = 0.4f) | ||
{ | ||
var ents = new HashSet<Entity<LayingDownComponent>>(); | ||
_lookup.GetEntitiesInRange(coords, range, ents); | ||
|
||
foreach (var ent in ents.Where(ent => ent.Owner != uid)) | ||
{ | ||
TryLieDown(ent, behavior: DropHeldItemsBehavior.DropIfStanding); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Требуются улучшения в методе LieDownInRange
Рекомендуемые изменения для повышения надежности и производительности:
- Добавить проверку на null для сервиса
_lookup
- Добавить валидацию параметра
range
(должен быть положительным) - Рассмотреть возможность использования пула объектов для
HashSet
public void LieDownInRange(EntityUid uid, EntityCoordinates coords, float range = 0.4f)
{
+ if (range <= 0)
+ return;
+
+ if (!Resolve(uid, ref _lookup))
+ return;
+
var ents = new HashSet<Entity<LayingDownComponent>>();
_lookup.GetEntitiesInRange(coords, range, ents);
foreach (var ent in ents.Where(ent => ent.Owner != uid))
{
TryLieDown(ent, behavior: DropHeldItemsBehavior.DropIfStanding);
}
}
Committable suggestion skipped: line range outside the PR's diff.
🧰 Tools
🪛 GitHub Check: build (ubuntu-latest)
[failure] 361-361:
The type or namespace name 'EntityCoordinates' could not be found (are you missing a using directive or an assembly reference?)
[failure] 361-361:
The type or namespace name 'EntityCoordinates' could not be found (are you missing a using directive or an assembly reference?)
🪛 GitHub Check: YAML Linter
[failure] 361-361:
The type or namespace name 'EntityCoordinates' could not be found (are you missing a using directive or an assembly reference?)
[failure] 361-361:
The type or namespace name 'EntityCoordinates' could not be found (are you missing a using directive or an assembly reference?)
🪛 GitHub Check: Test Packaging
[failure] 361-361:
The type or namespace name 'EntityCoordinates' could not be found (are you missing a using directive or an assembly reference?)
[failure] 361-361:
The type or namespace name 'EntityCoordinates' could not be found (are you missing a using directive or an assembly reference?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
Resources/Prototypes/_Backmen/Catalog/uplink_catalog.yml (1)
175-175
: Исправьте форматированиеНеобходимо:
- Исправить отступ в строке категорий (должно быть 2 пробела вместо 4)
- Добавить пустую строку в конец файла
categories: - - UplinkDeception + - UplinkDeception +🧰 Tools
🪛 yamllint (1.35.1)
[warning] 175-175: wrong indentation: expected 2 but found 4
(indentation)
[error] 175-175: no new line character at the end of file
(new-line-at-end-of-file)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (4)
Content.Server/Backmen/Teleporter/ExperimentalTeleporterComponent.cs
(1 hunks)Resources/Locale/en-US/_backmen/store/uplink-catalog.ftl
(1 hunks)Resources/Locale/ru-RU/_backmen/store/uplink-catalog.ftl
(1 hunks)Resources/Prototypes/_Backmen/Catalog/uplink_catalog.yml
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
- Resources/Locale/ru-RU/_backmen/store/uplink-catalog.ftl
- Resources/Locale/en-US/_backmen/store/uplink-catalog.ftl
- Content.Server/Backmen/Teleporter/ExperimentalTeleporterComponent.cs
🧰 Additional context used
🪛 yamllint (1.35.1)
Resources/Prototypes/_Backmen/Catalog/uplink_catalog.yml
[warning] 175-175: wrong indentation: expected 2 but found 4
(indentation)
[error] 175-175: no new line character at the end of file
(new-line-at-end-of-file)
🔇 Additional comments (1)
Resources/Prototypes/_Backmen/Catalog/uplink_catalog.yml (1)
167-175
: Проверьте баланс стоимости телепортера
Стоимость в 10 телекристаллов кажется низкой для экспериментального телепортера, учитывая его потенциальную полезность в обмане и скрытном перемещении. Для сравнения:
- Chainsword стоит 8 TC
- Nocturine Gland Injector стоит 8 TC
✅ Verification successful
Стоимость телепортера соответствует балансу игры
Анализ показывает, что стоимость в 10 TC является обоснованной:
- Большинство предметов в категории UplinkDeception стоят от 1 до 5 TC
- Самые дорогие предметы (Corpium) стоят 20 TC
- Учитывая ограниченное количество зарядов (4) и короткую дистанцию телепортации (3-8 метров), цена в 10 TC сбалансирована
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Check if localization keys exist
rg "uplink-experimental-syndicate-teleporter-(name|desc)" "Resources/Locale/"
Length of output: 509
Script:
#!/bin/bash
# Search for similar teleporter items and their costs
rg "Telecrystal: \d+" "Resources/Prototypes/_Backmen/Catalog/uplink_catalog.yml" -B2
# Search for items in UplinkDeception category
ast-grep --pattern 'categories:
- UplinkDeception'
Length of output: 3858
🧰 Tools
🪛 yamllint (1.35.1)
[warning] 175-175: wrong indentation: expected 2 but found 4
(indentation)
[error] 175-175: no new line character at the end of file
(new-line-at-end-of-file)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (2)
Content.Server/Backmen/Teleporter/ExperimentalTeleporterSystem.cs (2)
20-32
: Добавьте документацию к классуРекомендуется добавить XML-документацию, описывающую назначение системы и её основные функции.
Пример:
+ /// <summary> + /// Система, управляющая экспериментальным телепортером. + /// Обрабатывает телепортацию, аварийные ситуации и эффекты. + /// </summary> public sealed class ExperimentalTeleporterSystem : EntitySystem
88-115
: Добавьте документацию к вспомогательным методамРекомендуется добавить XML-документацию к методам для улучшения поддержки кода.
Пример:
+ /// <summary> + /// Проверяет наличие стены в указанных координатах. + /// </summary> + /// <param name="coords">Координаты для проверки</param> + /// <returns>true если обнаружена стена, иначе false</returns> private bool TryCheckWall(EntityCoordinates coords)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
Content.Server/Backmen/Teleporter/ExperimentalTeleporterSystem.cs
(1 hunks)
🧰 Additional context used
🪛 GitHub Check: build (ubuntu-latest)
Content.Server/Backmen/Teleporter/ExperimentalTeleporterSystem.cs
[failure] 59-59:
The type or namespace name 'GhostComponent' could not be found (are you missing a using directive or an assembly reference?)
[failure] 59-59:
The type or namespace name 'GhostComponent' could not be found (are you missing a using directive or an assembly reference?)
🪛 GitHub Check: YAML Linter
Content.Server/Backmen/Teleporter/ExperimentalTeleporterSystem.cs
[failure] 59-59:
The type or namespace name 'GhostComponent' could not be found (are you missing a using directive or an assembly reference?)
[failure] 59-59:
The type or namespace name 'GhostComponent' could not be found (are you missing a using directive or an assembly reference?)
🪛 GitHub Check: Test Packaging
Content.Server/Backmen/Teleporter/ExperimentalTeleporterSystem.cs
[failure] 59-59:
The type or namespace name 'GhostComponent' could not be found (are you missing a using directive or an assembly reference?)
[failure] 59-59:
The type or namespace name 'GhostComponent' could not be found (are you missing a using directive or an assembly reference?)
🔇 Additional comments (4)
Content.Server/Backmen/Teleporter/ExperimentalTeleporterSystem.cs (4)
33-37
: Инициализация реализована корректно
Подписка на событие UseInHandEvent
выполнена правильно.
78-86
: Метод телепортации реализован корректно
Логика телепортации, включая эффекты и изменение позиции, реализована правильно.
65-76
:
Добавьте защиту от бесконечной рекурсии
Метод может вызвать бесконечную рекурсию через Teleport
. Необходимо добавить ограничение на количество попыток телепортации.
39-63
: 🛠️ Refactor suggestion
Улучшите обработку использования телепортера
- Вынесите магическое число
3F
в константу - Добавьте проверку на null для компонента
- Упростите условия для лучшей читаемости
Предлагаемые изменения:
+ private const float GibSplatModifier = 3.0f;
private void OnUse(EntityUid uid, ExperimentalTeleporterComponent component, UseInHandEvent args)
{
+ if (!Resolve(args.User, ref xform))
+ return;
+
if (_charges.IsEmpty(uid)
- || !TryComp<TransformComponent>(args.User, out var xform)
|| (_containerSystem.IsEntityInContainer(args.User)
&& !_containerSystem.TryRemoveFromContainer(args.User)))
return;
// ...
- _bodySystem.GibBody(args.User, true, splatModifier: 3F);
+ _bodySystem.GibBody(args.User, true, splatModifier: GibSplatModifier);
}
Likely invalid or redundant comment.
🧰 Tools
🪛 GitHub Check: build (ubuntu-latest)
[failure] 59-59:
The type or namespace name 'GhostComponent' could not be found (are you missing a using directive or an assembly reference?)
[failure] 59-59:
The type or namespace name 'GhostComponent' could not be found (are you missing a using directive or an assembly reference?)
🪛 GitHub Check: YAML Linter
[failure] 59-59:
The type or namespace name 'GhostComponent' could not be found (are you missing a using directive or an assembly reference?)
[failure] 59-59:
The type or namespace name 'GhostComponent' could not be found (are you missing a using directive or an assembly reference?)
🪛 GitHub Check: Test Packaging
[failure] 59-59:
The type or namespace name 'GhostComponent' could not be found (are you missing a using directive or an assembly reference?)
[failure] 59-59:
The type or namespace name 'GhostComponent' could not be found (are you missing a using directive or an assembly reference?)
using System.Linq; | ||
using System.Numerics; | ||
using Content.Server.Body.Systems; | ||
using Content.Server.Standing; | ||
using Content.Shared.Backmen.Standing; | ||
using Content.Shared.Charges.Systems; | ||
using Content.Shared.Coordinates.Helpers; | ||
using Content.Shared.Interaction.Events; | ||
using Content.Shared.Maps; | ||
using Content.Shared.Tag; | ||
using Robust.Server.Audio; | ||
using Robust.Server.Containers; | ||
using Robust.Server.GameObjects; | ||
using Robust.Shared.Map; | ||
using Robust.Shared.Map.Components; | ||
using Robust.Shared.Random; | ||
|
||
namespace Content.Server._White.Teleporter; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Добавьте отсутствующий импорт и исправьте пространство имён
- Отсутствует импорт для
GhostComponent
- Пространство имён
Content.Server._White.Teleporter
не соответствует структуре остальных файлов вBackmen
Предлагаемые изменения:
+ using Content.Shared.Ghost;
- namespace Content.Server._White.Teleporter;
+ namespace Content.Server.Backmen.Teleporter;
📝 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.
using System.Linq; | |
using System.Numerics; | |
using Content.Server.Body.Systems; | |
using Content.Server.Standing; | |
using Content.Shared.Backmen.Standing; | |
using Content.Shared.Charges.Systems; | |
using Content.Shared.Coordinates.Helpers; | |
using Content.Shared.Interaction.Events; | |
using Content.Shared.Maps; | |
using Content.Shared.Tag; | |
using Robust.Server.Audio; | |
using Robust.Server.Containers; | |
using Robust.Server.GameObjects; | |
using Robust.Shared.Map; | |
using Robust.Shared.Map.Components; | |
using Robust.Shared.Random; | |
namespace Content.Server._White.Teleporter; | |
using System.Linq; | |
using System.Numerics; | |
using Content.Server.Body.Systems; | |
using Content.Server.Standing; | |
using Content.Shared.Backmen.Standing; | |
using Content.Shared.Charges.Systems; | |
using Content.Shared.Coordinates.Helpers; | |
using Content.Shared.Ghost; | |
using Content.Shared.Interaction.Events; | |
using Content.Shared.Maps; | |
using Content.Shared.Tag; | |
using Robust.Server.Audio; | |
using Robust.Server.Containers; | |
using Robust.Server.GameObjects; | |
using Robust.Shared.Map; | |
using Robust.Shared.Map.Components; | |
using Robust.Shared.Random; | |
namespace Content.Server.Backmen.Teleporter; |
оно всё ещё гибает призраков? |
Нет |
WWhiteDreamProject/wwdpublic#63
Описание PR
Медиа
Тип PR
Изменения
Summary by CodeRabbit