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:
@@ -37,7 +37,9 @@ namespace Content.Server.Rotatable
|
||||
|
||||
private void AddFlipVerb(EntityUid uid, FlippableComponent component, GetVerbsEvent<Verb> args)
|
||||
{
|
||||
if (!args.CanAccess || !args.CanInteract)
|
||||
if (!args.CanAccess
|
||||
|| !args.CanInteract
|
||||
|| !args.CanComplexInteract)
|
||||
return;
|
||||
|
||||
// Check if the object is anchored.
|
||||
@@ -60,6 +62,7 @@ namespace Content.Server.Rotatable
|
||||
{
|
||||
if (!args.CanAccess
|
||||
|| !args.CanInteract
|
||||
|| !args.CanComplexInteract
|
||||
|| Transform(uid).NoLocalRotation) // Good ol prototype inheritance, eh?
|
||||
return;
|
||||
|
||||
@@ -125,7 +128,9 @@ namespace Content.Server.Rotatable
|
||||
if (!TryComp<RotatableComponent>(entity, out var rotatableComp))
|
||||
return false;
|
||||
|
||||
if (!_actionBlocker.CanInteract(player, entity) || !_interaction.InRangeAndAccessible(player, entity))
|
||||
if (!_actionBlocker.CanInteract(player, entity)
|
||||
|| !_actionBlocker.CanComplexInteract(player)
|
||||
|| !_interaction.InRangeAndAccessible(player, entity))
|
||||
return false;
|
||||
|
||||
// Check if the object is anchored, and whether we are still allowed to rotate it.
|
||||
@@ -148,7 +153,9 @@ namespace Content.Server.Rotatable
|
||||
if (!TryComp<RotatableComponent>(entity, out var rotatableComp))
|
||||
return false;
|
||||
|
||||
if (!_actionBlocker.CanInteract(player, entity) || !_interaction.InRangeAndAccessible(player, entity))
|
||||
if (!_actionBlocker.CanInteract(player, entity)
|
||||
|| !_actionBlocker.CanComplexInteract(player)
|
||||
|| !_interaction.InRangeAndAccessible(player, entity))
|
||||
return false;
|
||||
|
||||
// Check if the object is anchored, and whether we are still allowed to rotate it.
|
||||
@@ -171,7 +178,9 @@ namespace Content.Server.Rotatable
|
||||
if (!TryComp<FlippableComponent>(entity, out var flippableComp))
|
||||
return false;
|
||||
|
||||
if (!_actionBlocker.CanInteract(player, entity) || !_interaction.InRangeAndAccessible(player, entity))
|
||||
if (!_actionBlocker.CanInteract(player, entity)
|
||||
|| !_actionBlocker.CanComplexInteract(player)
|
||||
|| !_interaction.InRangeAndAccessible(player, entity))
|
||||
return false;
|
||||
|
||||
// Check if the object is anchored.
|
||||
|
||||
Reference in New Issue
Block a user