using Content.Shared.ActionBlocker;
-using Content.Shared.Body.Systems;
using Content.Shared.Buckle.Components;
using Content.Shared.Climbing.Components;
using Content.Shared.Climbing.Events;
private const string ClimbingFixtureName = "climb";
private const int ClimbingCollisionGroup = (int) (CollisionGroup.TableLayer | CollisionGroup.LowImpassable);
+ private EntityQuery<ClimbableComponent> _climbableQuery;
private EntityQuery<FixturesComponent> _fixturesQuery;
private EntityQuery<TransformComponent> _xformQuery;
{
base.Initialize();
+ _climbableQuery = GetEntityQuery<ClimbableComponent>();
_fixturesQuery = GetEntityQuery<FixturesComponent>();
_xformQuery = GetEntityQuery<TransformComponent>();
{
if (args.OurFixtureId != ClimbingFixtureName
|| !component.IsClimbing
- || component.NextTransition != null
- || args.OurFixture.Contacts.Count > 1)
+ || component.NextTransition != null)
{
return;
}
+ if (args.OurFixture.Contacts.Count > 1)
+ {
+ foreach (var contact in args.OurFixture.Contacts.Values)
+ {
+ if (!contact.IsTouching)
+ continue;
+
+ var otherEnt = contact.EntityA;
+ var otherFixture = contact.FixtureA;
+ var otherFixtureId = contact.FixtureAId;
+ if (uid == contact.EntityA)
+ {
+ otherEnt = contact.EntityB;
+ otherFixture = contact.FixtureB;
+ otherFixtureId = contact.FixtureBId;
+ }
+
+ if (args.OtherEntity == otherEnt && args.OtherFixtureId == otherFixtureId)
+ continue;
+
+ if (otherFixture is { Hard: true } &&
+ _climbableQuery.HasComp(otherEnt))
+ {
+ return;
+ }
+ }
+ }
+
foreach (var otherFixture in args.OurFixture.Contacts.Keys)
{
// If it's the other fixture then ignore em