update custom remainsCollector event handlers
All checks were successful
Generate testing snapshot / Create testing release (push) Successful in 39s
All checks were successful
Generate testing snapshot / Create testing release (push) Successful in 39s
add extra verbose debug logging to determine owner, time, and whether or not the custom garbage collector is who processed the body
This commit is contained in:
@@ -27,17 +27,31 @@ addMissionEventHandler ["EntityKilled", {
|
|||||||
|
|
||||||
if not (_unit isKindOf "CAManBase") exitWith {};
|
if not (_unit isKindOf "CAManBase") exitWith {};
|
||||||
|
|
||||||
if not (isInRemainsCollector _unit) exitWith {};
|
|
||||||
|
|
||||||
// format["%1 from group %2 died at %3", _unit, group _unit, [datetime] call BIS_fnc_timeToString] remoteExec ["systemChat"];
|
|
||||||
_unit setVariable["milsim_death_time", time];
|
_unit setVariable["milsim_death_time", time];
|
||||||
// _unit addEventHandler ["Deleted", {
|
|
||||||
// params ["_entity"];
|
_unit addEventHandler ["Deleted", {
|
||||||
// isGC = _entity getVariable["milsim_garbage_collected", false];
|
params ["_entity"];
|
||||||
// format["%1 from was deleted by custom gc: %2", _entity, str isGC ] remoteExec ["systemChat"];
|
_remainsCollector = _entity getVariable["milsim_garbage_collected", false];
|
||||||
// }];
|
_decayTime = time - (_entity getVariable ["milsim_death_time", time]);
|
||||||
|
|
||||||
|
_i = allUsers select { (getUserInfo _x)#1 isEqualTo _ownerId;};
|
||||||
|
_owner = if ( _i isEqualTo []) then [ { "server" }, { (getUserInfo (_i#0))#3 }];
|
||||||
|
|
||||||
|
diag_log format["isServer: %5, deleted object owned by: %1 via remainsCollector: %2 after %3 seconds of type: %4", _owner, str (not _remainsCollector), _decayTime, _entity, isServer];
|
||||||
|
}];
|
||||||
}];
|
}];
|
||||||
|
|
||||||
|
|
||||||
|
// add zeus deletion logging to curator objects
|
||||||
|
{
|
||||||
|
_x addEventHandler ["CuratorObjectDeleted", {
|
||||||
|
params ["_curator", "_entity"];
|
||||||
|
|
||||||
|
_decayTime = time - (_entity getVariable ["milsim_death_time", time]);
|
||||||
|
diag_log format["deleted object: %1 via curator: %2 after %3 seconds", _entity, name _curator, _decayTime];
|
||||||
|
}];
|
||||||
|
} foreach _curators;
|
||||||
|
|
||||||
// declare init complete to other modules
|
// declare init complete to other modules
|
||||||
missionNamespace setVariable [QGVARMAIN(complete), true, true];
|
missionNamespace setVariable [QGVARMAIN(complete), true, true];
|
||||||
|
|
||||||
|
|||||||
@@ -27,11 +27,11 @@ GVAR(deadUnitCleanupPFH) = [
|
|||||||
_dead = _dead select [0, _toDelete];
|
_dead = _dead select [0, _toDelete];
|
||||||
{
|
{
|
||||||
_unit = _x#1;
|
_unit = _x#1;
|
||||||
// _unit setVariable ["milsim_garbage_collected", true];
|
_unit setVariable ["milsim_garbage_collected", true];
|
||||||
deleteVehicle (_unit);
|
deleteVehicle (_unit);
|
||||||
} foreach _dead;
|
} foreach _dead;
|
||||||
},
|
},
|
||||||
180,
|
450,
|
||||||
[],
|
[],
|
||||||
{ // on creation
|
{ // on creation
|
||||||
[
|
[
|
||||||
|
|||||||
Reference in New Issue
Block a user