Commit 02f345b9 authored by vabene1111's avatar vabene1111
Browse files

fix script error without spawn zones

when spawn choosing is disabled and the user forgets to add markers a script error triggers spawning the player at [0,0,0] and not finishing initialization
parent b3c8d7cd
......@@ -8,9 +8,14 @@
* https://www.bistudio.com/community/licenses/arma-public-license-share-alike/
* https://www.bistudio.com/monetization/
*/
params[
["_marker","",[""]],
["_spawnType",-1,[-1]]
];
params["_marker","_spawnType"];
if (_marker isEqualTo "") exitWith {
[nil, ["water"]] call BIS_fnc_randomPos;
};
if(_spawnType == -1) then {diag_log "<Desolation>: ERROR: Spawn mode not set. Default will be used";_spawnType = 0};
......
......@@ -28,7 +28,11 @@ if!(_enable) exitWith {
};
};
_spawnRegion = selectRandom _spawnRegions;
_spawnRegion = "";
if(count _spawnRegions > 0) then {
_spawnRegion = selectRandom _spawnRegions;
};
_spawnPos = [_spawnRegion,1] call DS_fnc_findSpawnPosition;
player setDir (random 360);
player setPosATL _spawnPos;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment