Equipment verbs & admin inventory access. (#14315)

This commit is contained in:
Leon Friedrich
2023-03-06 06:12:08 +13:00
committed by GitHub
parent a9b268af49
commit b148bebd60
29 changed files with 499 additions and 141 deletions

View File

@@ -93,6 +93,7 @@ namespace Content.Shared.Verbs
}
}
// TODO: fix this garbage and use proper generics or reflection or something else, not this.
if (types.Contains(typeof(InteractionVerb)))
{
var verbEvent = new GetVerbsEvent<InteractionVerb>(user, target, @using, hands, canInteract, canAccess);
@@ -145,6 +146,14 @@ namespace Content.Shared.Verbs
verbs.UnionWith(verbEvent.Verbs);
}
if (types.Contains(typeof(EquipmentVerb)))
{
var access = canAccess || _interactionSystem.CanAccessEquipment(user, target);
var verbEvent = new GetVerbsEvent<EquipmentVerb>(user, target, @using, hands, canInteract, access);
RaiseLocalEvent(target, verbEvent);
verbs.UnionWith(verbEvent.Verbs);
}
return verbs;
}