mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
convert magic numbers into macros, simplify a waitAndExecute
This commit is contained in:
parent
d86ceef484
commit
bc3260c8fc
@ -13,15 +13,12 @@ if (isServer) then {
|
||||
[QGVAR(bloodDropCreated), {
|
||||
params ["_bloodDrop"];
|
||||
GVAR(bloodDrops) pushBack _bloodDrop;
|
||||
if (count GVAR(bloodDrops) >= 500) then {
|
||||
if (count GVAR(bloodDrops) >= MAX_BLOOD_OBJECTS) then {
|
||||
private _deletedBloodDrop = GVAR(bloodDrops) deleteAt 0;
|
||||
deleteVehicle _deletedBloodDrop;
|
||||
};
|
||||
|
||||
[{
|
||||
params ["_bloodDrop"];
|
||||
deleteVehicle _bloodDrop;
|
||||
}, [_bloodDrop], 900] call CBA_fnc_waitAndExecute;
|
||||
[{deleteVehicle _this}, _bloodDrop, BLOOD_OBJECT_LIFETIME] call CBA_fnc_waitAndExecute;
|
||||
}] call CBA_fnc_addEventHandler;
|
||||
};
|
||||
|
||||
|
@ -16,3 +16,6 @@
|
||||
#endif
|
||||
|
||||
#include "\z\ace\addons\main\script_macros.hpp"
|
||||
|
||||
#define MAX_BLOOD_OBJECTS 500
|
||||
#define BLOOD_OBJECT_LIFETIME 900
|
||||
|
Loading…
Reference in New Issue
Block a user