From a67740f6ce19d0ad3fc0b712839ae439e3293200 Mon Sep 17 00:00:00 2001 From: Steve Date: Sun, 11 Feb 2018 11:26:32 +0000 Subject: [PATCH] Make teleporter a little less eager. --- src/entities/structures/teleporter.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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;