Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #123 from IrLED/UPSMON_cycle
Optimization of thread mass producers
- Loading branch information
Showing
8 changed files
with
85 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
scriptName "VEHdespawner"; | ||
params ["_vehicle"]; | ||
private ["_isListed","_vehiclePos","_city","_data","_unit"]; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,26 @@ | ||
_muerto = _this select 0; | ||
sleep cleantime; | ||
deleteVehicle _muerto; | ||
_grupo = group _muerto; | ||
if (!isNull _grupo) then | ||
{ | ||
if ({alive _x} count units _grupo == 0) then {deleteGroup _grupo}; | ||
} | ||
else | ||
{ | ||
if (_muerto in staticsToSave) then {staticsToSave = staticsToSave - [_muerto]; publicVariable "staticsToSave";}; | ||
}; | ||
|
||
if(isNil "postmortem_array") then { | ||
postmortem_array = []; | ||
[] spawn { | ||
scriptName "postmortem_cycle"; | ||
while {true} do { | ||
if (postmortem_array isEqualTo []) then { | ||
sleep 60; | ||
}else{ | ||
(postmortem_array deleteAt 0) params ["_what","_when"]; | ||
_when = _when - diag_tickTime; | ||
if ( _when > 1 ) then {sleep _when;}; | ||
deleteVehicle _what; | ||
private _group = group _what; | ||
if (!isNull _group) then { | ||
if ({alive _x} count units _group == 0) then {deleteGroup _group}; | ||
}else{ | ||
if (_what in staticsToSave) then {staticsToSave = staticsToSave - [_what]; publicVariable "staticsToSave";}; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; | ||
|
||
params ["_dead",["_cleanTOut",cleantime]]; | ||
postmortem_array pushBack [_dead, diag_tickTime + _cleanTOut]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters