mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Tabs be damned.
This commit is contained in:
parent
74b6036f3e
commit
431a21044a
@ -36,37 +36,37 @@ if (isNull _object) exitWith {};
|
||||
// If the tag is applied to an object, handle its destruction
|
||||
_object setVariable [QGVAR(testVar), true];
|
||||
if (_object getVariable [QGVAR(testVar), false]) then {
|
||||
// The object supports variables and hence HandleDamage too
|
||||
// Use the cheaper alternative for handling destruction: HandleDamage
|
||||
// The object supports variables and hence HandleDamage too
|
||||
// Use the cheaper alternative for handling destruction: HandleDamage
|
||||
|
||||
// If the object already has tags attached, just add the new one to the list
|
||||
private _attachedTags = _object getVariable QGVAR(attachedTags);
|
||||
if !(isNil "_attachedTags ") exitWith {
|
||||
_attachedTags pushBack _tag;
|
||||
};
|
||||
// If the object already has tags attached, just add the new one to the list
|
||||
private _attachedTags = _object getVariable QGVAR(attachedTags);
|
||||
if !(isNil "_attachedTags ") exitWith {
|
||||
_attachedTags pushBack _tag;
|
||||
};
|
||||
|
||||
_attachedTags = [_tag];
|
||||
_object setVariable [QGVAR(attachedTags), _attachedTags];
|
||||
_attachedTags = [_tag];
|
||||
_object setVariable [QGVAR(attachedTags), _attachedTags];
|
||||
|
||||
// If it's the first tag attached to that object, add a handledamage event handler
|
||||
_object addEventHandler ["HandleDamage", {
|
||||
params ["_object", "_selection", "_damage"];
|
||||
if (_selection == "" && _damage >= 1) then {
|
||||
{
|
||||
deleteVehicle _x;
|
||||
} foreach (_object getVariable [QGVAR(attachedTags), []]);
|
||||
_object setVariable [QGVAR(attachedTags), []];
|
||||
};
|
||||
}];
|
||||
// If it's the first tag attached to that object, add a handledamage event handler
|
||||
_object addEventHandler ["HandleDamage", {
|
||||
params ["_object", "_selection", "_damage"];
|
||||
if (_selection == "" && _damage >= 1) then {
|
||||
{
|
||||
deleteVehicle _x;
|
||||
} foreach (_object getVariable [QGVAR(attachedTags), []]);
|
||||
_object setVariable [QGVAR(attachedTags), []];
|
||||
};
|
||||
}];
|
||||
|
||||
} else {
|
||||
// The object doesn't supports variables
|
||||
// Use the more costly alternative: periodic testing
|
||||
GVAR(tagsToTest) pushBack [_tag, _tagPosASL, _vectorDirAndUp];
|
||||
// The object doesn't supports variables
|
||||
// Use the more costly alternative: periodic testing
|
||||
GVAR(tagsToTest) pushBack [_tag, _tagPosASL, _vectorDirAndUp];
|
||||
|
||||
// Run the tes
|
||||
if (!GVAR(testingThread)) then {
|
||||
call FUNC(tagTestingThread);
|
||||
};
|
||||
// Run the tes
|
||||
if (!GVAR(testingThread)) then {
|
||||
call FUNC(tagTestingThread);
|
||||
};
|
||||
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user