Change what items can be fultoned while stopping anchored items from fultoning (#20628)

* Check and restrict players from fultoning their equipped items

* Changed fulton whitelist to items and anchorables

* Stop from anchored items being fultoned

* Moved containermanager check to CanFulton function

* review

---------

Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
Kacper Urbańczyk
2024-01-20 05:57:05 +01:00
committed by GitHub
parent 87f324b648
commit 1ff31f8b7a
3 changed files with 21 additions and 9 deletions

View File

@@ -11,7 +11,6 @@ namespace Content.Server.Salvage;
public sealed class FultonSystem : SharedFultonSystem
{
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly SharedContainerSystem _container = default!;
public override void Initialize()
{
@@ -55,7 +54,8 @@ public sealed class FultonSystem : SharedFultonSystem
{
if (!Deleted(component.Beacon) &&
TryComp<TransformComponent>(component.Beacon, out var beaconXform) &&
!_container.IsEntityOrParentInContainer(component.Beacon.Value, xform: beaconXform))
!Container.IsEntityOrParentInContainer(component.Beacon.Value, xform: beaconXform) &&
CanFulton(uid))
{
var xform = Transform(uid);
var metadata = MetaData(uid);