Make teleporter a little less eager.

This commit is contained in:
Steve 2018-02-11 11:26:32 +00:00
parent 57aaafa789
commit a67740f6ce
1 changed files with 4 additions and 1 deletions

View File

@ -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;