Inline Deleted

This commit is contained in:
Vera Aguilera Puerto
2021-12-03 11:30:03 +01:00
parent 149707a566
commit b2035543e2
60 changed files with 94 additions and 79 deletions

View File

@@ -421,7 +421,7 @@ namespace Content.Server.Botany.Components
public bool DoHarvest(IEntity user)
{
if (Seed == null || user.Deleted || !EntitySystem.Get<ActionBlockerSystem>().CanInteract(user.Uid))
if (Seed == null || (!IoCManager.Resolve<IEntityManager>().EntityExists(user.Uid) ? EntityLifeStage.Deleted : IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(user.Uid).EntityLifeStage) >= EntityLifeStage.Deleted || !EntitySystem.Get<ActionBlockerSystem>().CanInteract(user.Uid))
return false;
if (Harvest && !Dead)
@@ -651,7 +651,7 @@ namespace Content.Server.Botany.Components
var user = eventArgs.User;
var usingItem = eventArgs.Using;
if (usingItem.Deleted || !EntitySystem.Get<ActionBlockerSystem>().CanInteract(user.Uid))
if ((!IoCManager.Resolve<IEntityManager>().EntityExists(usingItem.Uid) ? EntityLifeStage.Deleted : IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(usingItem.Uid).EntityLifeStage) >= EntityLifeStage.Deleted || !EntitySystem.Get<ActionBlockerSystem>().CanInteract(user.Uid))
return false;
if (usingItem.TryGetComponent(out SeedComponent? seeds))