Skip to content
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

Aghosts can now /ghost #29360

Merged
merged 1 commit into from
Jul 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Content.Server/GameTicking/GameTicker.GamePreset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ public bool OnGhostAttempt(EntityUid mindId, bool canReturnGlobal, bool viaComma
return false;
}

if (HasComp<GhostComponent>(playerEntity))
if (TryComp<GhostComponent>(playerEntity, out var comp) && !comp.CanGhostInteract)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I don't like this. The behavior here isn't obvious at all. Make a new data field instead?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It SOUNDS unintuitive, but that's basically the "this is an admin ghost" datafield on the GhostComponent. It's the only scenario where it's used, the only thing it could mean. Should we add a redundant datafield for clarity? Or perhaps would it be better to rename it (and every reference of it) to "IsAdminGhost" or something like that?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally a new property would be best but yeah I just looked at the code and see other code is already using this as an "is admin ghost" check so...

return false;

if (mind.VisitingEntity != default)
Expand Down
Loading