Mirror world tweaks.

This commit is contained in:
Steve 2018-05-13 17:25:00 +01:00
parent 0c631edd09
commit 230d28cef7
3 changed files with 10 additions and 9 deletions

View File

@ -147,7 +147,7 @@ static void load(cJSON *root)
if (game.plus & PLUS_MIRROR)
{
s->tx = MAP_PIXEL_WIDTH - s->tx;
self->tx = MAP_PIXEL_WIDTH - self->tx;
}
}

View File

@ -1156,8 +1156,9 @@ static void mirror(void)
case ET_LIFT:
s = (Structure*)self;
if (s->tx == s->x)
if (s->startX == s->x)
{
s->startX -= self->w;
s->tx -= self->w;
}
break;

View File

@ -188,6 +188,13 @@ static void loadEntities(cJSON *root)
self->load(node);
if (game.plus & PLUS_MIRROR)
{
self->x = MAP_PIXEL_WIDTH - self->x;
self->flags |= EF_MIRROR;
}
self->init();
self->animate();
@ -196,13 +203,6 @@ static void loadEntities(cJSON *root)
{
self->alive = ALIVE_DEAD;
}
if (game.plus & PLUS_MIRROR)
{
self->x = MAP_PIXEL_WIDTH - self->x;
self->flags |= EF_MIRROR;
}
}
}