mirror of
https://github.com/EpochModTeam/Epoch.git
synced 2024-08-30 18:22:13 +00:00
isNil check needed for nearestTerrainObjects?
This commit is contained in:
parent
68e33cf4f0
commit
6821e1895d
@ -18,14 +18,16 @@ private ["_shipwrecks","_item","_markers"];
|
|||||||
if (getNumber(configFile >> "CfgEpoch" >> worldname >> "shipwreckLootEnabled") isEqualTo 1) then {
|
if (getNumber(configFile >> "CfgEpoch" >> worldname >> "shipwreckLootEnabled") isEqualTo 1) then {
|
||||||
_worldSize = worldSize/2;
|
_worldSize = worldSize/2;
|
||||||
_shipwrecks = nearestTerrainObjects [ [_worldSize, _worldSize], ["SHIPWRECK"], _worldSize, false ];
|
_shipwrecks = nearestTerrainObjects [ [_worldSize, _worldSize], ["SHIPWRECK"], _worldSize, false ];
|
||||||
if (count _shipwrecks > 12) then {
|
if !(isNil "_shipwrecks") then {
|
||||||
_shipwrecks = (_shipwrecks call BIS_fnc_arrayShuffle) resize 12;
|
if (count _shipwrecks > 12) then {
|
||||||
};
|
_shipwrecks = (_shipwrecks call BIS_fnc_arrayShuffle) resize 12;
|
||||||
{
|
|
||||||
_item = createVehicle["container_epoch", _x, [], 0, "NONE"];
|
|
||||||
_item setMass 220;
|
|
||||||
if (EPOCH_SHOW_BOATLOOT) then {
|
|
||||||
_markers = ["Shipwreck",_x] call EPOCH_server_createGlobalMarkerSet;
|
|
||||||
};
|
};
|
||||||
} foreach _shipwrecks;
|
{
|
||||||
|
_item = createVehicle["container_epoch", _x, [], 0, "NONE"];
|
||||||
|
_item setMass 220;
|
||||||
|
if (EPOCH_SHOW_BOATLOOT) then {
|
||||||
|
_markers = ["Shipwreck",_x] call EPOCH_server_createGlobalMarkerSet;
|
||||||
|
};
|
||||||
|
} foreach _shipwrecks;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user