From 33f85098ce11f674d61c0a062e216691d03425be Mon Sep 17 00:00:00 2001 From: Fansana Date: Sun, 15 Dec 2024 16:16:24 +0100 Subject: [PATCH] rizzler --- Content.Server/FootPrint/FootPrintsSystem.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Content.Server/FootPrint/FootPrintsSystem.cs b/Content.Server/FootPrint/FootPrintsSystem.cs index b12cd5fb1d..8c5b7e2a3c 100644 --- a/Content.Server/FootPrint/FootPrintsSystem.cs +++ b/Content.Server/FootPrint/FootPrintsSystem.cs @@ -1,3 +1,4 @@ +using System.Linq; using Content.Server.Atmos.Components; using Content.Shared.Inventory; using Content.Shared.Mobs; @@ -21,6 +22,7 @@ public sealed class FootPrintsSystem : EntitySystem [Dependency] private readonly SharedSolutionContainerSystem _solution = default!; [Dependency] private readonly SharedAppearanceSystem _appearance = default!; [Dependency] private readonly SharedTransformSystem _transform = default!; + [Dependency] private readonly EntityLookupSystem _lookup = default!; private EntityQuery _transformQuery; private EntityQuery _mobThresholdQuery; @@ -47,10 +49,10 @@ private void OnStartupComponent(EntityUid uid, FootPrintsComponent component, Co private void OnMove(EntityUid uid, FootPrintsComponent component, ref MoveEvent args) { - if (component.PrintsColor.A <= 0f) + if (component.PrintsColor.A <= .2f) // avoid creating footsteps that are invisible component.DNAs.Clear(); - if (component.PrintsColor.A <= 0f + if (component.PrintsColor.A <= .2f || !_transformQuery.TryComp(uid, out var transform) || !_mobThresholdQuery.TryComp(uid, out var mobThreshHolds) || !_map.TryFindGridAt(_transform.GetMapCoordinates((uid, transform)), out var gridUid, out _)) @@ -64,6 +66,10 @@ private void OnMove(EntityUid uid, FootPrintsComponent component, ref MoveEvent if (!(distance > stepSize)) return; + var entities = _lookup.GetEntitiesIntersecting(uid, LookupFlags.All); + foreach (var entityUid in entities.Where(entityUid => HasComp(entityUid))) + return; //are we on a puddle? we exit, ideally we would exchange liquid and DNA with the puddle but meh, too lazy to do that now. + component.RightStep = !component.RightStep; var entity = Spawn(component.StepProtoId, CalcCoords(gridUid, component, transform, dragging));