Pulling rework (#20906)
* Pulling rework Fixing up the FOUR systems managing pulling, all the shitcode, and also making it nicer ingame. * More pulling cleanup * stats * More cleanup * First draft * More pulling * weh * Fix puller * Pulling working * Fix merge * Dunked * Self-merge time
This commit is contained in:
@@ -6,11 +6,10 @@ 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;
|
||||
|
||||
@@ -100,19 +99,19 @@ public sealed class StealConditionSystem : EntitySystem
|
||||
var count = 0;
|
||||
|
||||
//check pulling object
|
||||
if (TryComp<SharedPullerComponent>(mind.OwnedEntity, out var pull)) //TO DO: to make the code prettier? don't like the repetition
|
||||
if (TryComp<PullerComponent>(mind.OwnedEntity, out var pull)) //TO DO: to make the code prettier? don't like the repetition
|
||||
{
|
||||
var pullid = pull.Pulling;
|
||||
if (pullid != null)
|
||||
var pulledEntity = pull.Pulling;
|
||||
if (pulledEntity != null)
|
||||
{
|
||||
// check if this is the item
|
||||
if (CheckStealTarget(pullid.Value, condition)) count++;
|
||||
if (CheckStealTarget(pulledEntity.Value, condition)) count++;
|
||||
|
||||
//we don't check the inventories of sentient entity
|
||||
if (!TryComp<MindContainerComponent>(pullid, out var pullMind))
|
||||
if (!HasComp<MindContainerComponent>(pulledEntity))
|
||||
{
|
||||
// if it is a container check its contents
|
||||
if (_containerQuery.TryGetComponent(pullid, out var containerManager))
|
||||
if (_containerQuery.TryGetComponent(pulledEntity, out var containerManager))
|
||||
stack.Push(containerManager);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user