Files
DayZ-Epoch/SQF/dayz_code/system/fire_monitor.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

41 lines
1003 B
Plaintext

private["_firePlace","_ok","_mags","_serial","_qty","_countr"];
_firePlace = _this;
while {alive _firePlace} do {
while {inflamed _firePlace && alive _fireplace} do {
//Use Wood
_ok = false;
_mags = getMagazineCargo _firePlace;
clearMagazineCargoGlobal _firePlace;
clearWeaponCargoGlobal _firePlace;
_serial = (_mags select 0) find "PartWoodPile";
_qty = 0;
if (_serial >= 0) then {
_qty = (_mags select 1) select _serial;
};
_ok = false;
if (_qty > 0) then {
_qty = _qty - 1;
_ok = true;
if (_qty > 0) then {
_firePlace addMagazineCargoGlobal ["PartWoodPile",_qty];
};
};
if (_ok) then {
_countr = 0;
while {_ok} do {
_countr = _countr + 1;
if (_countr > 600) then {_ok = false};
if (!inflamed _firePlace) then {_ok = false};
if (!alive _firePlace) then {_ok = false};
uiSleep 1;
};
} else {
_firePlace inflame false;
};
};
while {!inflamed _firePlace && alive _fireplace} do {
//Wait
uiSleep 1;
};
uiSleep 1;
};