No context menu through occluder (#1934)

* No context menu through occluder

* Fix disabled occluders

* Comment

* Server-side verb ray check

Decided to add a buffer because the entity is at the very edge of the context box (0.5, 0.5) then need to make sure that entities at the other end of the box are ignored.

Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com>
This commit is contained in:
metalgearsloth
2020-08-29 20:46:42 +10:00
committed by GitHub
parent aa66aa2286
commit cc1125cd91
3 changed files with 87 additions and 8 deletions

View File

@@ -12,7 +12,7 @@ using static Content.Shared.GameObjects.EntitySystemMessages.VerbSystemMessages;
namespace Content.Server.GameObjects.EntitySystems
{
public class VerbSystem : EntitySystem
public class VerbSystem : SharedVerbSystem
{
[Dependency] private readonly IEntityManager _entityManager = default!;
@@ -93,6 +93,11 @@ namespace Content.Server.GameObjects.EntitySystems
return;
}
if (!TryGetContextEntities(userEntity, entity.Transform.MapPosition, out var entities, true) || !entities.Contains(entity))
{
return;
}
var data = new List<VerbsResponseMessage.NetVerbData>();
//Get verbs, component dependent.
foreach (var (component, verb) in VerbUtility.GetVerbs(entity))