Fix: Prevent single-use hyposprays from getting the toggle draw verb (#26595)
Prevent single-use hyposprays from getting the toggle draw verb Co-authored-by: Plykiya <plykiya@protonmail.com>
This commit is contained in:
@@ -30,4 +30,11 @@ public sealed partial class HyposprayComponent : Component
|
|||||||
[AutoNetworkedField]
|
[AutoNetworkedField]
|
||||||
[DataField(required: true)]
|
[DataField(required: true)]
|
||||||
public bool OnlyAffectsMobs = false;
|
public bool OnlyAffectsMobs = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether or not the hypospray is able to draw from containers or if it's a single use
|
||||||
|
/// device that can only inject.
|
||||||
|
/// </summary>
|
||||||
|
[DataField]
|
||||||
|
public bool InjectOnly = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ public abstract class SharedHypospraySystem : EntitySystem
|
|||||||
// </summary>
|
// </summary>
|
||||||
private void AddToggleModeVerb(Entity<HyposprayComponent> entity, ref GetVerbsEvent<AlternativeVerb> args)
|
private void AddToggleModeVerb(Entity<HyposprayComponent> entity, ref GetVerbsEvent<AlternativeVerb> args)
|
||||||
{
|
{
|
||||||
if (!args.CanAccess || !args.CanInteract || args.Hands == null)
|
if (!args.CanAccess || !args.CanInteract || args.Hands == null || entity.Comp.InjectOnly)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var (_, component) = entity;
|
var (_, component) = entity;
|
||||||
|
|||||||
@@ -115,6 +115,7 @@
|
|||||||
solutionName: pen
|
solutionName: pen
|
||||||
transferAmount: 15
|
transferAmount: 15
|
||||||
onlyAffectsMobs: false
|
onlyAffectsMobs: false
|
||||||
|
injectOnly: true
|
||||||
- type: Appearance
|
- type: Appearance
|
||||||
- type: SolutionContainerVisuals
|
- type: SolutionContainerVisuals
|
||||||
maxFillLevels: 1
|
maxFillLevels: 1
|
||||||
@@ -205,6 +206,7 @@
|
|||||||
solutionName: pen
|
solutionName: pen
|
||||||
transferAmount: 20
|
transferAmount: 20
|
||||||
onlyAffectsMobs: false
|
onlyAffectsMobs: false
|
||||||
|
injectOnly: true
|
||||||
- type: SolutionContainerManager
|
- type: SolutionContainerManager
|
||||||
solutions:
|
solutions:
|
||||||
pen:
|
pen:
|
||||||
@@ -236,6 +238,7 @@
|
|||||||
solutionName: pen
|
solutionName: pen
|
||||||
transferAmount: 20
|
transferAmount: 20
|
||||||
onlyAffectsMobs: false
|
onlyAffectsMobs: false
|
||||||
|
injectOnly: true
|
||||||
- type: SolutionContainerManager
|
- type: SolutionContainerManager
|
||||||
solutions:
|
solutions:
|
||||||
pen:
|
pen:
|
||||||
@@ -267,6 +270,8 @@
|
|||||||
solutionName: pen
|
solutionName: pen
|
||||||
transferAmount: 20
|
transferAmount: 20
|
||||||
onlyAffectsMobs: false
|
onlyAffectsMobs: false
|
||||||
|
injectOnly: true
|
||||||
|
|
||||||
- type: SolutionContainerManager
|
- type: SolutionContainerManager
|
||||||
solutions:
|
solutions:
|
||||||
pen:
|
pen:
|
||||||
@@ -299,6 +304,7 @@
|
|||||||
solutionName: pen
|
solutionName: pen
|
||||||
transferAmount: 30
|
transferAmount: 30
|
||||||
onlyAffectsMobs: false
|
onlyAffectsMobs: false
|
||||||
|
injectOnly: true
|
||||||
- type: SolutionContainerManager
|
- type: SolutionContainerManager
|
||||||
solutions:
|
solutions:
|
||||||
pen:
|
pen:
|
||||||
@@ -337,6 +343,7 @@
|
|||||||
solutionName: pen
|
solutionName: pen
|
||||||
transferAmount: 30
|
transferAmount: 30
|
||||||
onlyAffectsMobs: false
|
onlyAffectsMobs: false
|
||||||
|
injectOnly: true
|
||||||
- type: StaticPrice
|
- type: StaticPrice
|
||||||
price: 500
|
price: 500
|
||||||
- type: Tag
|
- type: Tag
|
||||||
@@ -397,6 +404,7 @@
|
|||||||
solutionName: pen
|
solutionName: pen
|
||||||
transferAmount: 30
|
transferAmount: 30
|
||||||
onlyAffectsMobs: false
|
onlyAffectsMobs: false
|
||||||
|
injectOnly: true
|
||||||
- type: StaticPrice
|
- type: StaticPrice
|
||||||
price: 500
|
price: 500
|
||||||
- type: Tag
|
- type: Tag
|
||||||
|
|||||||
Reference in New Issue
Block a user