mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-15 13:26:39 +03:00
0.7 + 1.7.5.M1D19
This commit is contained in:
@@ -7,22 +7,22 @@ _dateNow = _this select 3;
|
||||
_age = _this select 4;
|
||||
_locationstypes = _this select 5;
|
||||
_nearestCity = _this select 6;
|
||||
_nearby = _this select 7;
|
||||
|
||||
diag_log ("Loot Started");
|
||||
|
||||
{
|
||||
if (!_inVehicle) then {
|
||||
_looted = (_x getVariable ["looted",-0.1]);
|
||||
_dateNow = (DateToNumber date);
|
||||
_age = (_dateNow - _looted) * 525948;
|
||||
if (_age > 8) then {
|
||||
_keepAwayDist = ((sizeOf _type) + 5);
|
||||
_noPlayerNear = (count ((getPosATL _x) nearEntities ["CAManBase",_keepAwayDist])) == 0;
|
||||
if (_noPlayerNear) then {
|
||||
_x setVariable ["looted",_dateNow,true];
|
||||
[_x] call building_spawnLoot;
|
||||
};
|
||||
};
|
||||
};
|
||||
} forEach _nearby;
|
||||
|
||||
_looted = (_x getVariable ["looted",-0.1]);
|
||||
_cleared = (_x getVariable ["cleared",true]);
|
||||
_dateNow = (DateToNumber date);
|
||||
_age = (_dateNow - _looted) * 525948;
|
||||
//diag_log ("SPAWN LOOT: " + _type + " Building is " + str(_age) + " old" );
|
||||
if ((_age > 10) and (!_cleared)) then {
|
||||
_nearByObj = nearestObjects [(getPosATL _x), ["WeaponHolder","WeaponHolderBase"],((sizeOf _type)+5)];
|
||||
{deleteVehicle _x} forEach _nearByObj;
|
||||
_x setVariable ["cleared",true,true];
|
||||
_x setVariable ["looted",_dateNow,true];
|
||||
};
|
||||
if ((_age > 10) and (_cleared)) then {
|
||||
//Register
|
||||
_x setVariable ["looted",_dateNow,true];
|
||||
//cleanup
|
||||
_handle = [_x] spawn building_spawnLoot;
|
||||
waitUntil{scriptDone _handle};
|
||||
};
|
||||
Reference in New Issue
Block a user