From 021a02f8e9771395691e1fddfd205dc8a618844f Mon Sep 17 00:00:00 2001 From: Steve Date: Wed, 16 May 2018 08:06:37 +0100 Subject: [PATCH] Correctly adjust teleporter destination when mirroring. --- src/entities/structures/teleporter.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/entities/structures/teleporter.c b/src/entities/structures/teleporter.c index 457e208..e6d56e1 100644 --- a/src/entities/structures/teleporter.c +++ b/src/entities/structures/teleporter.c @@ -140,6 +140,11 @@ static void load(cJSON *root) s->active = cJSON_GetObjectItem(root, "active")->valueint; s->tx = cJSON_GetObjectItem(root, "tx")->valueint; s->ty = cJSON_GetObjectItem(root, "ty")->valueint; + + if (game.plus & PLUS_MIRROR) + { + s->tx = MAP_PIXEL_WIDTH - s->tx; + } } static void save(cJSON *root)