Add checks for various complex interactions (#37246)
* Prevent toggling radiation collectors * Prevent resisting locks * Prevent unbuckling others, early exit before doafter * Prevent camera and camera router setup * Prevent rotating and flipping * Also prevent adding the unbuckle verb. * Revert ResistLocker changes * Prevent emitter tampering * Also prevent lock verb * Prevent toggling welders * Prevent gun open/close bolt, rack and switch mode * Prevent toggling stun batons
This commit is contained in:
@@ -43,6 +43,10 @@ public abstract partial class SharedBuckleSystem
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!TryComp(args.Dragged, out BuckleComponent? buckle) ||
|
||||
!CanBuckle(args.Dragged, args.User, uid, true, out var _, buckle))
|
||||
return;
|
||||
|
||||
var doAfterArgs = new DoAfterArgs(EntityManager, args.User, component.BuckleDoafterTime, new BuckleDoAfterEvent(), args.Dragged, args.Dragged, uid)
|
||||
{
|
||||
BreakOnMove = true,
|
||||
@@ -200,6 +204,9 @@ public abstract partial class SharedBuckleSystem
|
||||
if (!args.CanAccess || !args.CanInteract || !component.Buckled)
|
||||
return;
|
||||
|
||||
if (!CanUnbuckle((uid, component), args.User, false))
|
||||
return;
|
||||
|
||||
InteractionVerb verb = new()
|
||||
{
|
||||
Act = () => TryUnbuckle(uid, args.User, buckleComp: component),
|
||||
|
||||
Reference in New Issue
Block a user