Emergency revert for pulling (#24923)

Revert "Pulling rework (#20906)"

This reverts commit 0d8254b2a2.
This commit is contained in:
Jezithyr
2024-02-03 10:32:30 -08:00
committed by GitHub
parent 914bab19e8
commit c15b0691ec
53 changed files with 1359 additions and 764 deletions

View File

@@ -6,10 +6,11 @@ using Content.Shared.Objectives.Systems;
using Robust.Shared.Containers;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
using Content.Shared.Pulling.Components;
using Content.Shared.Objectives;
using Content.Shared.Mind.Components;
using Content.Shared.Mobs.Systems;
using Content.Shared.Mobs.Components;
using Content.Shared.Movement.Pulling.Components;
namespace Content.Server.Objectives.Systems;
@@ -99,19 +100,19 @@ public sealed class StealConditionSystem : EntitySystem
var count = 0;
//check pulling object
if (TryComp<PullerComponent>(mind.OwnedEntity, out var pull)) //TO DO: to make the code prettier? don't like the repetition
if (TryComp<SharedPullerComponent>(mind.OwnedEntity, out var pull)) //TO DO: to make the code prettier? don't like the repetition
{
var pulledEntity = pull.Pulling;
if (pulledEntity != null)
var pullid = pull.Pulling;
if (pullid != null)
{
// check if this is the item
if (CheckStealTarget(pulledEntity.Value, condition)) count++;
if (CheckStealTarget(pullid.Value, condition)) count++;
//we don't check the inventories of sentient entity
if (!HasComp<MindContainerComponent>(pulledEntity))
if (!TryComp<MindContainerComponent>(pullid, out var pullMind))
{
// if it is a container check its contents
if (_containerQuery.TryGetComponent(pulledEntity, out var containerManager))
if (_containerQuery.TryGetComponent(pullid, out var containerManager))
stack.Push(containerManager);
}
}