diff --git a/src/entities/structures/teleporter.c b/src/entities/structures/teleporter.c index 13904e0..10dcaf4 100644 --- a/src/entities/structures/teleporter.c +++ b/src/entities/structures/teleporter.c @@ -83,9 +83,12 @@ static void action(void) static void touch(Entity *other) { + int mostlyInside; float tx, ty; - if (self->active && other != self && (other->flags & (EF_TELEPORTING | EF_NO_TELEPORT)) == 0) + mostlyInside = abs((self->x + (self->w / 2)) - other->x) < 8; + + if (self->active && mostlyInside && other != self && (other->flags & (EF_TELEPORTING | EF_NO_TELEPORT)) == 0) { tx = self->tx; other->tx += self->w / 2;