Files
DayZ-Epoch/SQF/dayz_code/compile/player_throwObject.sqf
icomrade c3ed4e49e1 Replace sleep with uiSleep
see the below links for more info. uiSleep is based off of a more
accurate method of tracking time, whereas sleep can fluctuate depending
on application performance since it is based on framerate.
https://community.bistudio.com/wiki/uiSleep
https://community.bistudio.com/wiki/sleep_vs_uiSleep
https://community.bistudio.com/wiki/sleep
2016-02-17 13:03:17 -05:00

33 lines
877 B
Plaintext

private ["_unit","_ammo","_distance","_weapon","_projectile","_endPos","_dir","_doWait","_vel"];
_unit = _this select 0;
_weapon = _this select 1;
_ammo = _this select 4;
_projectile = _this select 6;
_projectile = nearestObject [_unit, _ammo];
_endPos = getPosATL _projectile;
_dir = 0;
_doWait = true;
while {_doWait} do {
_vel = (velocity _projectile) distance [0,0,0];
if (!(alive _projectile)) then {_doWait = false};
if (_vel < 0.1) then {_doWait = false};
_endPos = getPosATL _projectile;
uiSleep 0.01;
};
_distance = parseNumber format["%1",(getArray (configFile >> "CfgAmmo" >> _ammo >> "soundHit") select 3)];
if (_ammo isKindOf "ChemLight") then {
_distance = 10;
};
if (_ammo isKindOf "RoadFlare") then {
if (call world_isDay) then {
_distance = 30;
} else {
_distance = 60;
};
};
[_unit,_distance,false,_endPos] spawn player_alertZombies;