From fc14f51859d04ef84ccc830e766684a7fc93f322 Mon Sep 17 00:00:00 2001 From: Sollace Date: Sun, 25 Dec 2022 23:23:11 +0100 Subject: [PATCH] Drop carried entities switching to a species that's not supposed to be able to carry other entities --- .../java/com/minelittlepony/unicopia/entity/Living.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/com/minelittlepony/unicopia/entity/Living.java b/src/main/java/com/minelittlepony/unicopia/entity/Living.java index 29a5ac3b..f756cd74 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/Living.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/Living.java @@ -165,6 +165,14 @@ public abstract class Living implements Equine, Caste } + if (isBeingCarried()) { + Pony carrier = Pony.of(entity.getVehicle()).orElse(null); + if (!carrier.getCompositeRace().any(Abilities.CARRY::canUse)) { + entity.stopRiding(); + entity.refreshPositionAfterTeleport(carrier.getOriginVector()); + Living.transmitPassengers(carrier.asEntity()); + } + } updateDragonBreath();