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

Make NeedHand modifiable for injectorSystem #29870

Merged
merged 2 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions Content.Server/Chemistry/EntitySystems/InjectorSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,9 @@ private void InjectDoAfter(Entity<InjectorComponent> injector, EntityUid target,
BreakOnMove = true,
BreakOnWeightlessMove = false,
BreakOnDamage = true,
NeedHand = true,
BreakOnHandChange = true,
MovementThreshold = 0.1f,
NeedHand = injector.Comp.NeedHand,
BreakOnHandChange = injector.Comp.BreakOnHandChange,
MovementThreshold = injector.Comp.MovementThreshold,
});
}

Expand Down
16 changes: 16 additions & 0 deletions Content.Shared/Chemistry/Components/InjectorComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,22 @@ public sealed partial class InjectorComponent : Component
[AutoNetworkedField]
[DataField]
public InjectorToggleMode ToggleState = InjectorToggleMode.Draw;

#region Arguments for injection doafter

/// <inheritdoc cref=DoAfterArgs.NeedHand>
[DataField]
public bool NeedHand = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

While I do understand it's a pretty drop in place replacement for the doafter variables, please leave summary comments about these, preferably explaining that they affect doafters and also explaining when you would ever want/need it to be false


/// <inheritdoc cref=DoAfterArgs.BreakOnHandChange>
[DataField]
public bool BreakOnHandChange = true;
Copy link
Contributor

@Plykiya Plykiya Jul 22, 2024

Choose a reason for hiding this comment

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

Same thing here, since I'm finding it hard to imagine why BreakOnChange would need to be false, are you trying to double inject someone...?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I made this one modifiable mainly because it appears to be quite related to the NeedHand variable. I haven't yet found a case where it would be set to false, but I don't see any reason to leave it hardcoded.

On another note, I think that I might turn couple other variables to be modifiable, particularly the one that tells how still you need to be, without it my WIP medibot change will need a nasty 0.1 second wait operator to let the bot stop moving, which currently translates to like 6 lines of yml, or 2 primitive tasks.


/// <inheritdoc cref=DoAfterArgs.MovementThreshold>
[DataField]
public float MovementThreshold = 0.1f;

#endregion
}

/// <summary>
Expand Down
Loading