mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Use cleanup settings, and force server TTL on the events.
This commit is contained in:
parent
e54c68f7f9
commit
ca74ce721d
@ -84,7 +84,7 @@ class ACE_Settings {
|
|||||||
};
|
};
|
||||||
class GVAR(litterCleanUpDelay) {
|
class GVAR(litterCleanUpDelay) {
|
||||||
typeName = "SCALAR";
|
typeName = "SCALAR";
|
||||||
value = -1;
|
value = 0;
|
||||||
};
|
};
|
||||||
class GVAR(medicSetting_PAK) {
|
class GVAR(medicSetting_PAK) {
|
||||||
typeName = "SCALAR";
|
typeName = "SCALAR";
|
||||||
|
@ -268,4 +268,4 @@ if (USE_WOUND_EVENT_SYNC) then {
|
|||||||
|
|
||||||
|
|
||||||
// Networked litter
|
// Networked litter
|
||||||
[QGVAR(createLitter), FUNC(handleCreateLitter)] call EFUNC(common,addSyncedEventHandler);
|
[QGVAR(createLitter), FUNC(handleCreateLitter), GVAR(litterCleanUpDelay)] call EFUNC(common,addSyncedEventHandler);
|
||||||
|
@ -47,6 +47,8 @@ _createLitter = {
|
|||||||
};
|
};
|
||||||
_direction = (random 360);
|
_direction = (random 360);
|
||||||
|
|
||||||
|
// Create the litter, and timeout the event based on the cleanup delay
|
||||||
|
// The cleanup delay for events in MP is handled by the server side
|
||||||
[QGVAR(createLitter), [_litterClass,_position,_direction], 0] call EFUNC(common,syncedEvent);
|
[QGVAR(createLitter), [_litterClass,_position,_direction], 0] call EFUNC(common,syncedEvent);
|
||||||
|
|
||||||
true
|
true
|
||||||
|
@ -31,10 +31,10 @@ if(!GVAR(litterPFHRunning) && {GVAR(litterCleanUpDelay) > 0}) then {
|
|||||||
if (time - (_x select 0) >= GVAR(litterCleanUpDelay)) then {
|
if (time - (_x select 0) >= GVAR(litterCleanUpDelay)) then {
|
||||||
{
|
{
|
||||||
deleteVehicle _x;
|
deleteVehicle _x;
|
||||||
} foreach (_this select 1);
|
} forEach (_x select 1);
|
||||||
GVAR(allCreatedLitter) set[_foreachIndex, objNull];
|
GVAR(allCreatedLitter) set[_foreachIndex, objNull];
|
||||||
};
|
};
|
||||||
}foreach GVAR(allCreatedLitter);
|
} forEach GVAR(allCreatedLitter);
|
||||||
GVAR(allCreatedLitter) = GVAR(allCreatedLitter) - [objNull];
|
GVAR(allCreatedLitter) = GVAR(allCreatedLitter) - [objNull];
|
||||||
|
|
||||||
if ( (count GVAR(allCreatedLitter)) == 0) exitwith {
|
if ( (count GVAR(allCreatedLitter)) == 0) exitwith {
|
||||||
|
Loading…
Reference in New Issue
Block a user