From cfed7789c79b1999db4704f7dfc52bfac9adfb96 Mon Sep 17 00:00:00 2001 From: nomisum Date: Fri, 22 Jan 2016 19:15:49 +0100 Subject: [PATCH] mapsize workarounds for old maps --- helpers/spawnBluforHQ.sqf | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/helpers/spawnBluforHQ.sqf b/helpers/spawnBluforHQ.sqf index 7b491ccd..96e2fd0c 100644 --- a/helpers/spawnBluforHQ.sqf +++ b/helpers/spawnBluforHQ.sqf @@ -73,10 +73,25 @@ testSpawnPositions = { _distance = _this select 2; _result = [2,nil,nil]; _mapsizeknown = false; - + + // check for arma3 map size _mapSize = worldSize; if (_mapSize < 2000) then { - _mapSizeKnown = false; diag_log format ["Calculating Spawnposis: Map Size < 2000 or unknown."]; + + // check for utes/chernarus + _mapSize = getNumber (configFile>>"CfgWorlds">>worldName>>"grid">>"zoom1">>"stepX")*(parseNumber mapGridPosition [0,0,0]); + + // check for OA terrains / takistan + if (_mapSize < 2000) then { + _mapSize = getNumber (configFile>>"CfgWorlds">>worldName>>"grid">>"offsety"); + }; + + // now im out of functions to get map size correctly + if (_mapSize < 2000) then { + _mapSizeKnown = false; diag_log format ["Calculating Spawnposis: Map Size < 2000 or unknown."]; + }; + + } else {_mapSizeKnown = true;};