Removed open and unlock for mobs with no hands (#9984)
* removed verbs open and unlock for mobs with no hands * fix the file where check the hands * fix now using HasComp looking for SharedHandsComponent * remove blank line * remove blank line Co-authored-by: zero <ribeirolucasdev@gmail.com>
This commit is contained in:
@@ -3,6 +3,7 @@ using Content.Shared.Emag.Systems;
|
|||||||
using Content.Shared.Access.Components;
|
using Content.Shared.Access.Components;
|
||||||
using Content.Shared.Access.Systems;
|
using Content.Shared.Access.Systems;
|
||||||
using Content.Shared.Examine;
|
using Content.Shared.Examine;
|
||||||
|
using Content.Shared.Hands.Components;
|
||||||
using Content.Shared.Interaction;
|
using Content.Shared.Interaction;
|
||||||
using Content.Shared.Popups;
|
using Content.Shared.Popups;
|
||||||
using Content.Shared.Storage;
|
using Content.Shared.Storage;
|
||||||
@@ -152,6 +153,9 @@ namespace Content.Server.Lock
|
|||||||
if (!Resolve(uid, ref storage, logMissing: false))
|
if (!Resolve(uid, ref storage, logMissing: false))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
if (!HasComp<SharedHandsComponent>(user))
|
||||||
|
return false;
|
||||||
|
|
||||||
// Cannot lock if the entity is currently opened.
|
// Cannot lock if the entity is currently opened.
|
||||||
if (storage.Open)
|
if (storage.Open)
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ using Content.Server.Storage.Components;
|
|||||||
using Content.Server.Tools.Systems;
|
using Content.Server.Tools.Systems;
|
||||||
using Content.Shared.Body.Components;
|
using Content.Shared.Body.Components;
|
||||||
using Content.Shared.Destructible;
|
using Content.Shared.Destructible;
|
||||||
|
using Content.Shared.Hands.Components;
|
||||||
using Content.Shared.Interaction;
|
using Content.Shared.Interaction;
|
||||||
using Content.Shared.Item;
|
using Content.Shared.Item;
|
||||||
using Content.Shared.Placeable;
|
using Content.Shared.Placeable;
|
||||||
@@ -148,7 +149,6 @@ public sealed class EntityStorageSystem : EntitySystem
|
|||||||
|
|
||||||
var ev = new StorageBeforeCloseEvent(uid, entities);
|
var ev = new StorageBeforeCloseEvent(uid, entities);
|
||||||
RaiseLocalEvent(uid, ev, true);
|
RaiseLocalEvent(uid, ev, true);
|
||||||
|
|
||||||
var count = 0;
|
var count = 0;
|
||||||
foreach (var entity in ev.Contents)
|
foreach (var entity in ev.Contents)
|
||||||
{
|
{
|
||||||
@@ -233,6 +233,9 @@ public sealed class EntityStorageSystem : EntitySystem
|
|||||||
if (!Resolve(target, ref component))
|
if (!Resolve(target, ref component))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (!HasComp<SharedHandsComponent>(user))
|
||||||
|
return false;
|
||||||
|
|
||||||
if (component.IsWeldedShut)
|
if (component.IsWeldedShut)
|
||||||
{
|
{
|
||||||
if (!silent && !component.Contents.Contains(user))
|
if (!silent && !component.Contents.Contains(user))
|
||||||
@@ -361,6 +364,5 @@ public sealed class EntityStorageSystem : EntitySystem
|
|||||||
appearance.SetData(StorageVisuals.Open, component.Open);
|
appearance.SetData(StorageVisuals.Open, component.Open);
|
||||||
appearance.SetData(StorageVisuals.HasContents, component.Contents.ContainedEntities.Count() > 0);
|
appearance.SetData(StorageVisuals.HasContents, component.Contents.ContainedEntities.Count() > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user