mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 12:12:34 +03:00
detect and count spawn markers to ensure markers exist
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
private ["_characterID","_playerObj","_playerID","_dummy","_worldspace","_state","_doLoop","_key","_primary","_medical","_stats","_humanity","_lastinstance","_friendlies","_randomSpot","_position","_debug","_distance","_hit","_fractures","_score","_findSpot","_pos","_isIsland","_w","_clientID","_spawnMC"];
|
private ["_characterID","_playerObj","_playerID","_dummy","_worldspace","_state","_doLoop","_key","_primary","_medical","_stats","_humanity","_lastinstance","_friendlies","_randomSpot","_position","_debug","_distance","_hit","_fractures","_score","_findSpot","_pos","_isIsland","_w","_clientID","_spawnMC","_namespace"];
|
||||||
|
|
||||||
//diag_log ("SETUP: attempted with " + str(_this));
|
//diag_log ("SETUP: attempted with " + str(_this));
|
||||||
|
|
||||||
@@ -188,12 +188,9 @@ if (_randomSpot) then {
|
|||||||
if(isnil "spawnShoremode") then {
|
if(isnil "spawnShoremode") then {
|
||||||
spawnShoremode = 1;
|
spawnShoremode = 1;
|
||||||
};
|
};
|
||||||
if(isnil "spawnMarkerCount") then {
|
|
||||||
spawnMarkerCount = 4;
|
|
||||||
};
|
|
||||||
|
|
||||||
// The wiki states floor has a uniform distribution but will not reach the last number so we add +1
|
//
|
||||||
_spawnMC = spawnMarkerCount + 1;
|
_spawnMC = actualSpawnMarkerCount;
|
||||||
|
|
||||||
//spawn into random
|
//spawn into random
|
||||||
_findSpot = true;
|
_findSpot = true;
|
||||||
|
|||||||
@@ -366,6 +366,25 @@ if (isServer and isNil "sm_done") then {
|
|||||||
_debugMarkerPosition = [(_debugMarkerPosition select 0),(_debugMarkerPosition select 1),1];
|
_debugMarkerPosition = [(_debugMarkerPosition select 0),(_debugMarkerPosition select 1),1];
|
||||||
_vehicle_0 = createVehicle ["DebugBox_DZ", _debugMarkerPosition, [], 0, "CAN_COLLIDE"];
|
_vehicle_0 = createVehicle ["DebugBox_DZ", _debugMarkerPosition, [], 0, "CAN_COLLIDE"];
|
||||||
_vehicle_0 setPos _debugMarkerPosition;
|
_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;
|
sm_done = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user