Fix some machine construction bugs. (#18179)

This commit is contained in:
Leon Friedrich
2023-07-30 05:29:59 +12:00
committed by GitHub
parent 55f935e3fe
commit 35d6d490f1
4 changed files with 194 additions and 108 deletions

View File

@@ -167,6 +167,7 @@ namespace Content.Shared.Stacks
amount = Math.Min(amount, GetMaxCount(component));
amount = Math.Max(amount, 0);
// Server-side override deletes the entity if count == 0
component.Count = amount;
Dirty(component);

View File

@@ -28,6 +28,7 @@ namespace Content.Shared.Stacks
/// <summary>
/// Set to true to not reduce the count when used.
/// Note that <see cref="Count"/> still limits the amount that can be used at any one time.
/// </summary>
[DataField("unlimited")]
[ViewVariables(VVAccess.ReadOnly)]