Merge branch 'master' into 20-06-24-movement-prediction

This commit is contained in:
Pieter-Jan Briers
2020-06-24 04:04:43 +02:00
2259 changed files with 16436 additions and 11772 deletions

View File

@@ -7,6 +7,7 @@ using Content.Server.GameObjects.EntitySystems;
using Content.Shared.GameObjects;
using Content.Shared.GameObjects.Components.Interactable;
using Content.Shared.GameObjects.Components.Storage;
using Content.Shared.GameObjects.EntitySystems;
using Content.Shared.Interfaces;
using Robust.Server.GameObjects;
using Robust.Server.GameObjects.Components.Container;
@@ -338,8 +339,13 @@ namespace Content.Server.GameObjects.Components
{
protected override void GetData(IEntity user, EntityStorageComponent component, VerbData data)
{
component.OpenVerbGetData(user, component, data);
if (!ActionBlockerSystem.CanInteract(user))
{
data.Visibility = VerbVisibility.Invisible;
return;
}
component.OpenVerbGetData(user, component, data);
}
/// <inheritdoc />
@@ -351,6 +357,12 @@ namespace Content.Server.GameObjects.Components
protected virtual void OpenVerbGetData(IEntity user, EntityStorageComponent component, VerbData data)
{
if (!ActionBlockerSystem.CanInteract(user))
{
data.Visibility = VerbVisibility.Invisible;
return;
}
if (IsWeldedShut)
{
data.Visibility = VerbVisibility.Disabled;

View File

@@ -117,7 +117,9 @@ namespace Content.Server.GameObjects
{
protected override void GetData(IEntity user, ItemComponent component, VerbData data)
{
if (ContainerHelpers.IsInContainer(component.Owner) || !component.CanPickup(user))
if (!ActionBlockerSystem.CanInteract(user) ||
ContainerHelpers.IsInContainer(component.Owner) ||
!component.CanPickup(user))
{
data.Visibility = VerbVisibility.Invisible;
return;

View File

@@ -3,6 +3,7 @@ using Content.Server.GameObjects.EntitySystems;
using Content.Server.Interfaces;
using Content.Shared.GameObjects;
using Content.Shared.GameObjects.Components.Storage;
using Content.Shared.GameObjects.EntitySystems;
using Content.Shared.Interfaces;
using Robust.Server.GameObjects;
using Robust.Server.GameObjects.EntitySystems;
@@ -139,7 +140,7 @@ namespace Content.Server.GameObjects.Components.Items.Storage
{
protected override void GetData(IEntity user, SecureEntityStorageComponent component, VerbData data)
{
if (component.Open)
if (!ActionBlockerSystem.CanInteract(user) || component.Open)
{
data.Visibility = VerbVisibility.Invisible;
return;

View File

@@ -32,7 +32,7 @@ namespace Content.Server.GameObjects
[RegisterComponent]
[ComponentReference(typeof(IActivate))]
[ComponentReference(typeof(IStorageComponent))]
public class ServerStorageComponent : SharedStorageComponent, IInteractUsing, IUse, IActivate, IStorageComponent, IDestroyAct
public class ServerStorageComponent : SharedStorageComponent, IInteractUsing, IUse, IActivate, IStorageComponent, IDestroyAct, IExAct
{
#pragma warning disable 649
[Dependency] private readonly IMapManager _mapManager;
@@ -364,6 +364,24 @@ namespace Content.Server.GameObjects
}
}
void IExAct.OnExplosion(ExplosionEventArgs eventArgs)
{
if (eventArgs.Severity < ExplosionSeverity.Heavy)
{
return;
}
var storedEntities = storage.ContainedEntities.ToList();
foreach (var entity in storedEntities)
{
var exActs = entity.GetAllComponents<IExAct>();
foreach (var exAct in exActs)
{
exAct.OnExplosion(eventArgs);
}
}
}
/// <summary>
/// Inserts an entity into the storage component from the players active hand.
/// </summary>