From e4268e2ddb9ab1fe663dd58acae85ab0225ead90 Mon Sep 17 00:00:00 2001 From: Atermonera Date: Wed, 20 Feb 2019 00:31:13 -0800 Subject: [PATCH] Merge pull request #5967 from Verkister/patch-21 Fixes submap footprint miscalculations --- code/modules/maps/tg/map_template.dm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/code/modules/maps/tg/map_template.dm b/code/modules/maps/tg/map_template.dm index 27105b0701..9dcd218c81 100644 --- a/code/modules/maps/tg/map_template.dm +++ b/code/modules/maps/tg/map_template.dm @@ -40,8 +40,12 @@ var/list/global/map_templates = list() /datum/map_template/proc/preload_size(path, orientation = SOUTH) var/bounds = maploader.load_map(file(path), 1, 1, 1, cropMap=FALSE, measureOnly=TRUE, orientation=orientation) if(bounds) - width = bounds[MAP_MAXX] // Assumes all templates are rectangular, have a single Z level, and begin at 1,1,1 - height = bounds[MAP_MAXY] + if(orientation & (90 | 270)) + width = bounds[MAP_MAXY] + height = bounds[MAP_MAXX] + else + width = bounds[MAP_MAXX] // Assumes all templates are rectangular, have a single Z level, and begin at 1,1,1 + height = bounds[MAP_MAXY] return bounds /datum/map_template/proc/initTemplateBounds(var/list/bounds)