mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-20 10:26:28 +03:00
Fix some errors
This commit is contained in:
@@ -1,19 +1,5 @@
|
||||
private ["_random","_lastIndex","_weights","_index","_vehicle","_velimit","_qty","_isAir","_isShip","_position","_dir","_istoomany","_veh","_objPosition","_iClass","_itemTypes","_cntWeights","_itemType","_num","_allCfgLoots"];
|
||||
|
||||
if (isNil "spawn_vehicles_init") then {
|
||||
spawn_vehicles_init = "done";
|
||||
// Get all buildings and roads only once. Very taxing, but only on first startup
|
||||
buildingList = [];
|
||||
{
|
||||
if (DZE_MissionLootTable) then {
|
||||
if (isClass (missionConfigFile >> "CfgLoot" >> "Buildings" >> (typeOf _x))) then {buildingList set [count buildingList,_x];};
|
||||
} else {
|
||||
if (isClass (configFile >> "CfgLoot" >> "Buildings" >> (typeOf _x))) then {buildingList set [count buildingList,_x];};
|
||||
};
|
||||
} count (dayz_centerMarker nearObjects ["building",DynamicVehicleArea]);
|
||||
roadList = dayz_centerMarker nearRoads DynamicVehicleArea;
|
||||
};
|
||||
|
||||
while {count AllowedVehiclesList > 0} do {
|
||||
// BIS_fnc_selectRandom replaced because the index may be needed to remove the element
|
||||
_index = floor random count AllowedVehiclesList;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* Needs updating
|
||||
private ["_guaranteedLoot","_randomizedLoot","_spawnChance","_spawnMarker","_spawnRadius","_spawnFire","_fadeFire","_crashModel","_lootTable","_crashName","_spawnRoll","_position","_crash","_config","_hasAdjustment","_newHeight","_adjustedPos","_num","_itemTypes","_index","_weights","_cntWeights","_nearby","_itemType","_needsrelocated","_istoomany","_pos","_lootPos"];
|
||||
|
||||
_guaranteedLoot = 3;
|
||||
@@ -98,4 +99,6 @@ _nearby = _pos nearObjects ["ReammoBox", sizeOf(_crashModel)];
|
||||
{
|
||||
_x setVariable ["permaLoot",true];
|
||||
} count _nearBy;
|
||||
};
|
||||
};
|
||||
|
||||
*/
|
||||
@@ -1,3 +1,4 @@
|
||||
/* Needs updating
|
||||
private ["_guaranteedLoot","_randomizedLoot","_spawnChance","_spawnMarker","_spawnRadius","_crashModel","_lootTable","_spawnRoll","_position","_crash","_config","_num","_itemTypes","_index","_weights","_cntWeights","_nearby","_itemType","_needsrelocated","_istoomany","_pos","_lootPos"];
|
||||
|
||||
_guaranteedLoot = 4;
|
||||
@@ -65,4 +66,5 @@ _nearby = _position nearObjects ["ReammoBox", sizeOf(_crashModel)];
|
||||
{
|
||||
_x setVariable ["permaLoot",true];
|
||||
} count _nearBy;
|
||||
};
|
||||
};
|
||||
*/
|
||||
@@ -340,10 +340,21 @@ if !(DZE_ConfigTrader) then {
|
||||
|
||||
if (_hiveLoaded) then {
|
||||
// spawn_vehicles
|
||||
// Get all buildings and roads only once. Very taxing, but only on first startup
|
||||
buildingList = [];
|
||||
{
|
||||
if (DZE_MissionLootTable) then {
|
||||
if (isClass (missionConfigFile >> "CfgLoot" >> "Buildings" >> (typeOf _x))) then {buildingList set [count buildingList,_x];};
|
||||
} else {
|
||||
if (isClass (configFile >> "CfgLoot" >> "Buildings" >> (typeOf _x))) then {buildingList set [count buildingList,_x];};
|
||||
};
|
||||
} count (dayz_centerMarker nearObjects ["building",DynamicVehicleArea]);
|
||||
roadList = dayz_centerMarker nearRoads DynamicVehicleArea;
|
||||
|
||||
_vehLimit = MaxVehicleLimit - (count serverVehicleCounter);
|
||||
if (_vehLimit > 0) then {
|
||||
diag_log ("HIVE: Spawning # of Vehicles: " + str(_vehLimit));
|
||||
for "_x" from 1 to _vehLimit do {[] spawn spawn_vehicles;};
|
||||
for "_x" from 1 to _vehLimit do {spawn_vehicles_thread = [] spawn spawn_vehicles;};
|
||||
} else {
|
||||
diag_log "HIVE: Vehicle Spawn limit reached!";
|
||||
};
|
||||
@@ -358,12 +369,16 @@ for "_x" from 1 to MaxAmmoBoxes do {[] spawn spawn_ammosupply;};
|
||||
diag_log ("HIVE: Spawning # of Veins: " + str(MaxMineVeins));
|
||||
for "_x" from 1 to MaxMineVeins do {[] spawn spawn_mineveins;};
|
||||
|
||||
// All done spawning stuff, can clear these now
|
||||
buildingList = []; roadList = [];
|
||||
|
||||
[] spawn server_spawnEvents;
|
||||
_debugMarkerPosition = getMarkerPos "respawn_west";
|
||||
_debugMarkerPosition = [(_debugMarkerPosition select 0),(_debugMarkerPosition select 1),1];
|
||||
_vehicle_0 = createVehicle ["DebugBox_DZ", _debugMarkerPosition, [], 0, "CAN_COLLIDE"];
|
||||
_vehicle_0 setPos _debugMarkerPosition;
|
||||
_vehicle_0 setVariable ["ObjectID","1",true];
|
||||
_vehicle_0 setVariable ["ObjectID","1",true];
|
||||
|
||||
[] spawn {
|
||||
waitUntil {uiSleep 5;(scriptDone spawn_vehicles_thread)};
|
||||
// All done spawning stuff, can clear these now
|
||||
buildingList = nil; roadList = nil;
|
||||
diag_log "All vehicle spawning threads completed";
|
||||
};
|
||||
Reference in New Issue
Block a user