detect and count spawn markers to ensure markers exist

This commit is contained in:
[VB]AWOL
2013-10-23 00:44:48 -05:00
parent 207f4e3b88
commit 507eee89c7
2 changed files with 22 additions and 6 deletions

View File

@@ -366,6 +366,25 @@ if (isServer and isNil "sm_done") then {
_debugMarkerPosition = [(_debugMarkerPosition select 0),(_debugMarkerPosition select 1),1];
_vehicle_0 = createVehicle ["DebugBox_DZ", _debugMarkerPosition, [], 0, "CAN_COLLIDE"];
_vehicle_0 setPos _debugMarkerPosition;
// max number of spawn markers
if(isnil "spawnMarkerCount") then {
spawnMarkerCount = 10;
};
actualSpawnMarkerCount = 0;
// count valid spawn marker positions
for "_i" from 0 to spawnMarkerCount do {
if (!([(getMarkerPos format["spawn%1", _i]), [0,0,0]] call BIS_fnc_areEqual)) then {
actualSpawnMarkerCount = actualSpawnMarkerCount + 1;
} else {
// exit since we did not find any further markers
_i = spawnMarkerCount + 99;
};
};
diag_log format["Total Number of spawn locations %1", actualSpawnMarkerCount];
};
sm_done = true;