[DataField, ViewVariables(VVAccess.ReadWrite)]
public EntProtoId? BrokenPrototype;
+ /// <summary>
+ /// Whether or not these cuffs are in the process of being removed.
+ /// Used simply to prevent spawning multiple <see cref="BrokenPrototype"/>.
+ /// </summary>
+ [DataField]
+ public bool Removing;
+
[DataField, ViewVariables(VVAccess.ReadWrite)]
public DamageSpecifier DamageOnResist = new()
{
if (!Resolve(target, ref cuffable) || !Resolve(cuffsToRemove, ref cuff))
return;
- if (TerminatingOrDeleted(cuffsToRemove) || TerminatingOrDeleted(target))
+ if (cuff.Removing || TerminatingOrDeleted(cuffsToRemove) || TerminatingOrDeleted(target))
return;
if (user != null)
return;
}
+ cuff.Removing = true;
_audio.PlayPredicted(cuff.EndUncuffSound, target, user);
_container.Remove(cuffsToRemove, cuffable.Container);
}
}
}
+ cuff.Removing = false;
}
#region ActionBlocker
- type: Construction
graph: makeshifthandcuffs
node: cuffscable
+ - type: Item
+ inhandVisuals:
+ left:
+ - state: inhand-left
+ color: forestgreen
+ right:
+ - state: inhand-right
+ color: forestgreen
- type: Sprite
sprite: Objects/Misc/cablecuffs.rsi
state: cuff
sprite: Objects/Misc/cablecuffs.rsi
state: cuff-broken
color: forestgreen
+ - type: Item
+ inhandVisuals:
+ left:
+ - state: inhand-left
+ color: forestgreen
+ right:
+ - state: inhand-right
+ color: forestgreen
- type: entity
parent: Handcuffs