Use cleanup settings, and force server TTL on the events.

This commit is contained in:
jaynus 2015-04-18 11:48:44 -07:00
parent e54c68f7f9
commit ca74ce721d
4 changed files with 6 additions and 4 deletions

View File

@ -84,7 +84,7 @@ class ACE_Settings {
};
class GVAR(litterCleanUpDelay) {
typeName = "SCALAR";
value = -1;
value = 0;
};
class GVAR(medicSetting_PAK) {
typeName = "SCALAR";

View File

@ -268,4 +268,4 @@ if (USE_WOUND_EVENT_SYNC) then {
// Networked litter
[QGVAR(createLitter), FUNC(handleCreateLitter)] call EFUNC(common,addSyncedEventHandler);
[QGVAR(createLitter), FUNC(handleCreateLitter), GVAR(litterCleanUpDelay)] call EFUNC(common,addSyncedEventHandler);

View File

@ -47,6 +47,8 @@ _createLitter = {
};
_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);
true

View File

@ -31,10 +31,10 @@ if(!GVAR(litterPFHRunning) && {GVAR(litterCleanUpDelay) > 0}) then {
if (time - (_x select 0) >= GVAR(litterCleanUpDelay)) then {
{
deleteVehicle _x;
} foreach (_this select 1);
} forEach (_x select 1);
GVAR(allCreatedLitter) set[_foreachIndex, objNull];
};
}foreach GVAR(allCreatedLitter);
} forEach GVAR(allCreatedLitter);
GVAR(allCreatedLitter) = GVAR(allCreatedLitter) - [objNull];
if ( (count GVAR(allCreatedLitter)) == 0) exitwith {