This commit is contained in:
Leon Friedrich
2022-03-17 20:13:31 +13:00
committed by GitHub
parent 7b84362901
commit bfd95c493b
94 changed files with 1454 additions and 2185 deletions

View File

@@ -1,12 +1,8 @@
using Content.Server.Hands.Components;
using Content.Server.Holiday;
using Content.Shared.Item;
using Content.Shared.Hands.EntitySystems;
using Content.Shared.Roles;
using JetBrains.Annotations;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Server.Jobs
@@ -26,17 +22,16 @@ namespace Content.Server.Jobs
if (string.IsNullOrEmpty(Holiday) || string.IsNullOrEmpty(Prototype))
return;
if (!EntitySystem.Get<HolidaySystem>().IsCurrentlyHoliday(Holiday))
var sysMan = IoCManager.Resolve<IEntitySystemManager>();
if (!sysMan.GetEntitySystem<HolidaySystem>().IsCurrentlyHoliday(Holiday))
return;
var entMan = IoCManager.Resolve<IEntityManager>();
var entity = entMan.SpawnEntity(Prototype, entMan.GetComponent<TransformComponent>(mob).Coordinates);
if (!entMan.TryGetComponent(entity, out SharedItemComponent? item) || !entMan.TryGetComponent(mob, out HandsComponent? hands))
return;
hands.PutInHand(item, false);
sysMan.GetEntitySystem<SharedHandsSystem>().PickupOrDrop(mob, entity);
}
}
}