mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-13 19:52:38 +03:00
@@ -3,7 +3,7 @@ Spawns the specified loot definition at the specified location.
|
||||
|
||||
Parameters:
|
||||
array Loot definition
|
||||
vector Loot position (AGL)
|
||||
vector Spawn position relative to world
|
||||
|
||||
Return value:
|
||||
object Spawned vehicle.
|
||||
@@ -54,7 +54,12 @@ switch (_lootInfo select 0) do
|
||||
Debug_Assert(typeName (_lootInfo select 1) == typeName "" && { (_lootInfo select 1) != "" });
|
||||
//Debug_Log(String_Format2("DEBUG: Loot_Spawn Weapon: %1 Position: %2", _lootInfo select 1, _this select 1));
|
||||
|
||||
if (surfaceIsWater (_this select 1)) then {
|
||||
_vehicle setPos (_this select 1);
|
||||
} else {
|
||||
_vehicle setPosATL (_this select 1);
|
||||
};
|
||||
|
||||
INCREMENT_WEAPON_HOLDERS();
|
||||
|
||||
_magazines = getArray (configFile >> "CfgWeapons" >> _lootInfo select 1 >> "magazines");
|
||||
@@ -86,7 +91,11 @@ switch (_lootInfo select 0) do
|
||||
};
|
||||
_vehicle = createVehicle ["WeaponHolder", _this select 1, [], 0, "CAN_COLLIDE"];
|
||||
_vehicle addMagazineCargoGlobal [_item, 1];
|
||||
if (surfaceIsWater (_this select 1)) then {
|
||||
_vehicle setPos (_this select 1);
|
||||
} else {
|
||||
_vehicle setPosATL (_this select 1);
|
||||
};
|
||||
INCREMENT_WEAPON_HOLDERS();
|
||||
};
|
||||
|
||||
@@ -106,10 +115,18 @@ switch (_lootInfo select 0) do
|
||||
_p = Vector_SetZ(_p, Vector_Z(_p) + Vector_Z(getPosATL _vehicle));
|
||||
|
||||
_vehicle setVectorDirAndUp [Vector_DOWN, _d];
|
||||
if (surfaceIsWater _p) then {
|
||||
_vehicle setPos _p;
|
||||
} else {
|
||||
_vehicle setPosATL _p;
|
||||
};
|
||||
#else
|
||||
_vehicle = createVehicle [_lootInfo select 1, _this select 1, [], 0, "CAN_COLLIDE"];
|
||||
if (surfaceIsWater (_this select 1)) then {
|
||||
_vehicle setPos (_this select 1);
|
||||
} else {
|
||||
_vehicle setPosATL (_this select 1);
|
||||
};
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -119,7 +136,11 @@ switch (_lootInfo select 0) do
|
||||
_spawnCount = (_lootInfo select 2) + floor random ((_lootInfo select 3) - (_lootInfo select 2) + 1);
|
||||
_vehicle = createVehicle ["WeaponHolder", _this select 1, [], 0, "CAN_COLLIDE"];
|
||||
Loot_InsertCargo(_vehicle, _lootInfo select 1, _spawnCount);
|
||||
if (surfaceIsWater (_this select 1)) then {
|
||||
_vehicle setPos (_this select 1);
|
||||
} else {
|
||||
_vehicle setPosATL (_this select 1);
|
||||
};
|
||||
INCREMENT_WEAPON_HOLDERS();
|
||||
};
|
||||
|
||||
@@ -128,7 +149,11 @@ switch (_lootInfo select 0) do
|
||||
{
|
||||
_vehicle = createVehicle [_lootInfo select 1, _this select 1, [], 0, "CAN_COLLIDE"];
|
||||
_vehicle setDir random 360;
|
||||
if (surfaceIsWater (_this select 1)) then {
|
||||
_vehicle setPos (_this select 1);
|
||||
} else {
|
||||
_vehicle setPosATL (_this select 1);
|
||||
};
|
||||
};
|
||||
|
||||
//Spawn a container and populate it with loot from a given group
|
||||
@@ -143,7 +168,11 @@ switch (_lootInfo select 0) do
|
||||
Loot_InsertCargo(_vehicle, _lootInfo select 2, _spawnCount);
|
||||
|
||||
_vehicle setDir random 360;
|
||||
if (surfaceIsWater (_this select 1)) then {
|
||||
_vehicle setPos (_this select 1);
|
||||
} else {
|
||||
_vehicle setPosATL (_this select 1);
|
||||
};
|
||||
};
|
||||
|
||||
//Call a function which is assumed to return an object reference.
|
||||
@@ -151,7 +180,13 @@ switch (_lootInfo select 0) do
|
||||
{
|
||||
_vehicle = call (_lootInfo select 1);
|
||||
if ((typeName _vehicle) != "OBJECT") exitWith {};
|
||||
if (!isNull _vehicle) then { _vehicle setPos (_this select 1); };
|
||||
if (!isNull _vehicle) then {
|
||||
if (surfaceIsWater (_this select 1)) then {
|
||||
_vehicle setPos (_this select 1);
|
||||
} else {
|
||||
_vehicle setPosATL (_this select 1);
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user