Skip to content

Commit

Permalink
General - Change object config lookups to configOf (#8795)
Browse files Browse the repository at this point in the history
* configOf lookups

* forEach, missed configOf

* revert handcuff distance change

Co-authored-by: Filip Maciejewski <veteran29@users.noreply.github.com>

* optimize condition

Co-authored-by: Filip Maciejewski <veteran29@users.noreply.github.com>

* capitalization

Co-authored-by: Filip Maciejewski <veteran29@users.noreply.github.com>

* use object in getVehicleIcon

Co-authored-by: Filip Maciejewski <veteran29@users.noreply.github.com>

* add return comment

Co-authored-by: Filip Maciejewski <veteran29@users.noreply.github.com>

* remove extra brackets

Co-authored-by: Filip Maciejewski <veteran29@users.noreply.github.com>

* add missing brackets

Co-authored-by: Filip Maciejewski <veteran29@users.noreply.github.com>

* add return comment pt2

Co-authored-by: Filip Maciejewski <veteran29@users.noreply.github.com>

* revert to cursorTarget

Co-authored-by: Filip Maciejewski <veteran29@users.noreply.github.com>
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
  • Loading branch information
3 people authored Mar 9, 2022
1 parent 38a308e commit 68ed199
Show file tree
Hide file tree
Showing 34 changed files with 95 additions and 99 deletions.
2 changes: 1 addition & 1 deletion addons/artillerytables/functions/fnc_turretChanged.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
params ["_player", "_turret"];
private _vehicle = vehicle _player;
private _typeOf = typeOf _vehicle;
private _vehicleCfg = configFile >> "CfgVehicles" >> _typeOf;
private _vehicleCfg = configOf _vehicle;

// config "ace_artillerytables_showGunLaying" [0 disabled, 1 enabled, 2 enabled w/ alt elevationMode] falls back to artilleryScanner
private _showGunLaying = if (isNumber (_vehicleCfg >> QGVAR(showGunLaying))) then {
Expand Down
8 changes: 4 additions & 4 deletions addons/backpacks/functions/fnc_isBackpack.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@

params [["_backpack", objNull, [objNull, ""]]];

if (_backpack isEqualType objNull) then {
_backpack = typeOf _backpack;
private _config = if (_backpack isEqualType objNull) then {
configOf _backpack
} else {
configFile >> "CfgVehicles" >> _backpack
};

private _config = configFile >> "CfgVehicles" >> _backpack;

getText (_config >> "vehicleClass") == "backpacks" && {getNumber (_config >> "maximumLoad") > 0} // return
4 changes: 2 additions & 2 deletions addons/captives/CfgVehicles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class CfgVehicles {
class ACE_ApplyHandcuffs {
displayName = CSTRING(SetCaptive);
selection = "righthand";
distance = 2;
distance = HANDCUFFS_DISTANCE;
condition = QUOTE([ARR_2(_player, _target)] call FUNC(canApplyHandcuffs));
statement = QUOTE([ARR_2(_player, _target)] call FUNC(doApplyHandcuffs));
exceptions[] = {"isNotSwimming", "isNotInside"};
Expand All @@ -16,7 +16,7 @@ class CfgVehicles {
class ACE_RemoveHandcuffs {
displayName = CSTRING(ReleaseCaptive);
selection = "righthand";
distance = 2;
distance = HANDCUFFS_DISTANCE;
condition = QUOTE([ARR_2(_player, _target)] call FUNC(canRemoveHandcuffs));
statement = QUOTE([ARR_2(_player, _target)] call FUNC(doRemoveHandcuffs));
exceptions[] = {"isNotSwimming", "isNotInside"};
Expand Down
2 changes: 1 addition & 1 deletion addons/captives/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ if (!hasInterface) exitWith {};
private _target = cursorObject;
if !([ACE_player, _target, []] call EFUNC(common,canInteractWith)) exitWith {false};
if !(_target isKindOf "CAManBase") exitWith {false};
if ((_target distance ACE_player) > getNumber (configFile >> "CfgVehicles" >> "CAManBase" >> "ACE_Actions" >> "ACE_ApplyHandcuffs" >> "distance")) exitWith {false};
if ((_target distance ACE_player) > getNumber (configOf ACE_player >> "ACE_Actions" >> "ACE_ApplyHandcuffs" >> "distance")) exitWith {false};

if ([ACE_player, _target] call FUNC(canApplyHandcuffs)) exitWith {
[ACE_player, _target] call FUNC(doApplyHandcuffs);
Expand Down
2 changes: 2 additions & 0 deletions addons/captives/script_component.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@
#endif

#include "\z\ace\addons\main\script_macros.hpp"

#define HANDCUFFS_DISTANCE 2
3 changes: 2 additions & 1 deletion addons/cargo/functions/fnc_initObject.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@

params ["_object"];
private _type = typeOf _object;
private _config = configOf _object;
TRACE_2("params",_object,_type);

// If object had size given to it via eden/public then override config canLoad setting
private _canLoadPublic = _object getVariable [QGVAR(canLoad), false];
if (!(_canLoadPublic isEqualType false)) then {
WARNING_4("%1[%2] - Variable %3 is %4 - Should be bool",_object,_type,QGVAR(canLoad),_canLoadPublic);
};
private _canLoadConfig = getNumber (configFile >> "CfgVehicles" >> _type >> QGVAR(canLoad)) == 1;
private _canLoadConfig = getNumber (_config >> QGVAR(canLoad)) == 1;

// Nothing to do here if object can't be loaded
if !(_canLoadConfig || {_canLoadPublic in [true, 1]}) exitWith {};
Expand Down
15 changes: 7 additions & 8 deletions addons/cargo/functions/fnc_initVehicle.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ params ["_vehicle"];
TRACE_1("params", _vehicle);

private _type = typeOf _vehicle;
private _config = configOf _vehicle;

// If vehicle had space given to it via eden/public then override config hasCargo setting
private _hasCargoPublic = _vehicle getVariable [QGVAR(hasCargo), false];
private _hasCargoConfig = getNumber (configFile >> "CfgVehicles" >> _type >> QGVAR(hasCargo)) == 1;
private _hasCargoConfig = getNumber (_config >> QGVAR(hasCargo)) == 1;

// Nothing to do here if vehicle has no cargo space
if !(_hasCargoConfig || _hasCargoPublic) exitWith {};
Expand All @@ -40,13 +41,11 @@ if (_addCargoType) then {
// Vehicle can have default ace cargo in its config
if (isServer) then {
{
if (isClass _x) then {
private _cargoClassname = getText (_x >> "type");
private _cargoCount = getNumber (_x >> "amount");
TRACE_3("adding ACE_Cargo", (configName _x), _cargoClassname, _cargoCount);
["ace_addCargo", [_cargoClassname, _vehicle, _cargoCount]] call CBA_fnc_localEvent;
};
} count ("true" configClasses (configFile >> "CfgVehicles" >> _type >> "ACE_Cargo" >> "Cargo"));
private _cargoClassname = getText (_x >> "type");
private _cargoCount = getNumber (_x >> "amount");
TRACE_3("adding ACE_Cargo", (configName _x), _cargoClassname, _cargoCount);
["ace_addCargo", [_cargoClassname, _vehicle, _cargoCount]] call CBA_fnc_localEvent;
} forEach ("true" configClasses (_config >> QUOTE(ADDON) >> "Cargo"));
};

// Servers and HCs do not require action menus (beyond this point)
Expand Down
10 changes: 7 additions & 3 deletions addons/common/functions/fnc_findUnloadPosition.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,13 @@ if (_cargo isKindOf "CAManBase") then {
_radiusOfItem = 1.1;
} else {
//`sizeOf` is unreliable, and does not work with object types that don't exist on map, so estimate size based on cargo size
private _typeOfCargo = if (_cargo isEqualType "") then {_cargo} else {typeOf _cargo};
private _itemSize = if (isNumber (configFile >> "CfgVehicles" >> _typeOfCargo >> QEGVAR(cargo,size)) && {getNumber (configFile >> "CfgVehicles" >> _typeOfCargo >> QEGVAR(cargo,size)) != -1}) then {
getNumber (configFile >> "CfgVehicles" >> _typeOfCargo >> QEGVAR(cargo,size));
private _configOfCargo = if (_cargo isEqualType objNull) then {
configOf _cargo
} else {
configFile >> "CfgVehicles" >> _cargo
};
private _itemSize = if (isNumber (_configOfCargo >> QEGVAR(cargo,size)) && {getNumber (_configOfCargo >> QEGVAR(cargo,size)) != -1}) then {
getNumber (_configOfCargo >> QEGVAR(cargo,size));
} else {
if (["ace_cargo"] call FUNC(isModLoaded)) then {
[_cargo] call EFUNC(cargo,getSizeItem);
Expand Down
2 changes: 1 addition & 1 deletion addons/common/functions/fnc_getVehicleCargo.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

params [["_vehicle", objNull, [objNull]]];

private _config = configFile >> "CfgVehicles" >> _vehicle;
private _config = configOf _vehicle;

private _cargo = [];
private _codrivers = getArray (_config >> "cargoIsCoDriver");
Expand Down
2 changes: 1 addition & 1 deletion addons/common/functions/fnc_getVehicleCodriver.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

params [["_vehicle", objNull, [objNull]]];

private _config = configFile >> "CfgVehicles" >> _vehicle;
private _config = configOf _vehicle;

private _cargo = [];
private _codrivers = getArray (_config >> "cargoIsCoDriver");
Expand Down
2 changes: 1 addition & 1 deletion addons/common/functions/fnc_getVehicleIcon.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

params [["_object", objNull, [objNull, ""]]];

if ((_object isEqualType objNull && {isNull _object}) || {_object isEqualType "" && {_object == ""}}) exitWith { DEFAULT_TEXTURE };
if (_object isEqualTo objNull || {_object isEqualTo ""}) exitWith { DEFAULT_TEXTURE };

private _objectType = if (_object isEqualType objNull) then {
typeOf _object
Expand Down
2 changes: 1 addition & 1 deletion addons/csw/functions/fnc_proxyWeapon.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ if (_staticWeapon getVariable [format [QGVAR(proxyHandled_%1), _turret], false])

private _proxyWeapon = getText (configOf _staticWeapon >> "ace_csw" >> "proxyWeapon");

TRACE_2("",_typeOf,_proxyWeapon);
TRACE_2("",typeOf _staticWeapon,_proxyWeapon);
if (_proxyWeapon == "") exitWith {};

private _currentWeapon = (_staticWeapon weaponsTurret [0]) param [0, "#none"];
Expand Down
2 changes: 1 addition & 1 deletion addons/explosives/functions/fnc_setupExplosive.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ params ["_vehicle", "_unit", "_magClassname"];
TRACE_3("params",_vehicle,_unit,_magClassname);

//Get setup object vehicle and model:
private _setupObjectClass = getText(ConfigFile >> "CfgMagazines" >> _magClassname >> QGVAR(SetupObject));
private _setupObjectClass = getText (configFile >> "CfgMagazines" >> _magClassname >> QGVAR(SetupObject));
if (!isClass (configFile >> "CfgVehicles" >> _setupObjectClass)) exitWith {ERROR("Bad Vehicle");};
private _p3dModel = getText (configFile >> "CfgVehicles" >> _setupObjectClass >> "model");
if (_p3dModel == "") exitWith {ERROR("No Model");}; //"" - will crash game!
Expand Down
6 changes: 3 additions & 3 deletions addons/field_rations/functions/fnc_drinkFromSource.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ private _fnc_condition = {
[_player, _source] call FUNC(canDrinkFromSource)
};

private _sourceType = typeOf _source;
private _progressText = if (_sourceType == "") then {
private _sourceConfig = configOf _source;
private _progressText = if (isNull _sourceConfig) then {
LLSTRING(DrinkingFromSource)
} else {
format [LLSTRING(DrinkingFromX), getText (configFile >> "CfgVehicles" >> _sourceType >> "displayName")]
format [LLSTRING(DrinkingFromX), getText (_sourceConfig >> "displayName")]
};

[
Expand Down
6 changes: 3 additions & 3 deletions addons/field_rations/functions/fnc_getActionOffset.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@

params ["_object"];

private _typeOf = typeOf _object;
if (_typeOf != "") then {
private _configOf = configOf _object;
if !(isNull _configOf) then {
// Check for offset in config since we have valid typeOf
private _offset = getArray (configFile >> "CfgVehicles" >> _typeOf >> QXGVAR(offset));
private _offset = getArray (_configOf >> QXGVAR(offset));
if (_offset isEqualTo []) then {[0, 0, 0]} else {_offset};
} else {
// Check for offset corresponding to p3d list
Expand Down
6 changes: 3 additions & 3 deletions addons/field_rations/functions/fnc_getRemainingWater.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ if (!alive _source) exitWith {0};
private _water = _source getVariable QGVAR(currentWaterSupply);

if (isNil "_water") then {
private _typeOf = typeOf _source;
if (_typeOf != "") then {
private _configOf = configOf _source;
if !(isNull _configOf) then {
// Check for waterSupply entry since we have valid typeOf
_water = getNumber (configFile >> "CfgVehicles" >> _typeOf >> QXGVAR(waterSupply));
_water = getNumber (_configOf >> QXGVAR(waterSupply));
if (_water == 0) then {_water = REFILL_WATER_DISABLED};

if (_water != REFILL_WATER_DISABLED) then {
Expand Down
2 changes: 1 addition & 1 deletion addons/gunbag/functions/fnc_hasGunbag.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@

params ["_unit"];

getNumber (configFile >> "CfgVehicles" >> (backpack _unit) >> QUOTE(ADDON)) == 1
getNumber ((configOf (backpackContainer _unit)) >> QUOTE(ADDON)) == 1
2 changes: 1 addition & 1 deletion addons/intelitems/functions/fnc_attributeFocus.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ private _object = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull);
_control ctrlRemoveAllEventHandlers "SetFocus";

private _ctrlLabel = _display displayCtrl IDC_ATTRIBUTE_LABEL;
private _labelText = getText (configFile >> "CfgVehicles" >> typeOf _object >> "Attributes" >> QGVAR(data) >> "displayName");
private _labelText = getText ((configOf _object) >> "Attributes" >> QGVAR(data) >> "displayName");
_ctrlLabel ctrlSetText _labelText;

private _index = _object getVariable [QGVAR(index), -1];
Expand Down
2 changes: 1 addition & 1 deletion addons/intelitems/functions/fnc_canPickup.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@

params ["_object", "_player"];

private _magazineClass = getText (configFile >> "CfgVehicles" >> typeOf _object >> QGVAR(magazine));
private _magazineClass = getText ((configOf _object) >> QGVAR(magazine));

_magazineClass != "" && {_player canAdd _magazineClass}
2 changes: 1 addition & 1 deletion addons/intelitems/functions/fnc_pickup.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

params ["_object", "_player"];

private _magazineClass = getText (configFile >> "CfgVehicles" >> typeOf _object >> QGVAR(magazine));
private _magazineClass = getText ((configOf _object) >> QGVAR(magazine));
private _index = _object getVariable [QGVAR(index), -1];

// Add magazine to inventory and get its id
Expand Down
5 changes: 2 additions & 3 deletions addons/interact_menu/functions/fnc_createVehiclesActions.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@
params ["_vehicles", "_statement", "_target"];

_vehicles apply {
private _type = typeOf _x;
private _name = getText (configFile >> "CfgVehicles" >> _type >> "displayName");
private _name = getText ((configOf _x) >> "displayName");
private _ownerName = [_x, true] call EFUNC(common,getName);
if ("" != _ownerName) then {
_name = format ["%1 (%2)", _name, _ownerName];
};
private _icon = [_type] call EFUNC(common,getVehicleIcon);
private _icon = [_x] call EFUNC(common,getVehicleIcon);
private _action = [format ["%1", _x], _name, _icon, _statement, {true}, {}, _x] call EFUNC(interact_menu,createAction);
[_action, [], _target]
}
46 changes: 21 additions & 25 deletions addons/interact_menu/functions/fnc_userActions_addHouseActions.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,21 @@ if ((vehicle ACE_player) != ACE_player) exitWith {};

[{
params ["_args", "_pfID"];
_args params ["_setPosition", "_addedHelpers", "_housesScaned", "_housesToScanForActions"];
_args params ["_setPosition", "_addedHelpers", "_housesScanned", "_housesToScanForActions"];

if (!EGVAR(interact_menu,keyDown)) then {
{deleteVehicle _x;} forEach _addedHelpers;
[_pfID] call CBA_fnc_removePerFrameHandler;
} else {
// Prevent Rare Error when ending mission with interact key down:
if (isNull ace_player) exitWith {};
if (isNull ACE_player) exitWith {};

//Make the common case fast (cursorTarget is looking at a door):
if ((!isNull cursorTarget) && {cursorTarget isKindOf "Static"} && {!(cursorTarget in _housesScaned)}) then {
if ((!isNull cursorTarget) && {cursorTarget isKindOf "Static"} && {!(cursorTarget in _housesScanned)}) then {
if (((count (configOf cursorTarget >> "UserActions")) > 0) || {(count (getArray (configOf cursorTarget >> "ladders"))) > 0}) then {
_housesToScanForActions = [cursorTarget];
} else {
_housesScaned pushBack cursorTarget;
_housesScanned pushBack cursorTarget;
};
};

Expand All @@ -51,47 +51,43 @@ if ((vehicle ACE_player) != ACE_player) exitWith {};

if (_housesToScanForActions isEqualTo []) then {
//If player moved >2 meters from last pos, then rescan
if (((getPosASL ace_player) distance _setPosition) < 2) exitWith {};
if (((getPosASL ACE_player) distance _setPosition) < 2) exitWith {};

private _nearBuidlings = nearestObjects [ace_player, ["Static"], 30];
private _nearBuidlings = nearestObjects [ACE_player, ["Static"], 30];
{
private _typeOfHouse = typeOf _x;
if (((count (configFile >> "CfgVehicles" >> _typeOfHouse >> "UserActions")) == 0) && {(count (getArray (configFile >> "CfgVehicles" >> _typeOfHouse >> "ladders"))) == 0}) then {
_housesScaned pushBack _x;
private _configOfHouse = configOf _x;
if (((count (_configOfHouse >> "UserActions")) == 0) && {(count (getArray (_configOfHouse >> "ladders"))) == 0}) then {
_housesScanned pushBack _x;
} else {
_housesToScanForActions pushBack _x;
};
nil
} count (_nearBuidlings - _housesScaned);
} forEach (_nearBuidlings - _housesScanned);

_args set [0, (getPosASL ace_player)];
_args set [0, (getPosASL ACE_player)];
} else {
private _houseBeingScaned = _housesToScanForActions deleteAt 0;
private _typeOfHouse = typeOf _houseBeingScaned;
private _houseBeingScanned = _housesToScanForActions deleteAt 0;
//Skip this house for now if we are outside of it's radius
//(we have to scan far out for the big houses, but we don't want to waste time adding actions on every little shack)
if ((_houseBeingScaned != cursorTarget) && {((ACE_player distance _houseBeingScaned) - ((sizeOf _typeOfHouse) / 2)) > 4}) exitWith {};
if ((_houseBeingScanned != cursorTarget) && {((ACE_player distance _houseBeingScanned) - ((boundingBoxReal _houseBeingScanned) select 2)) > 4}) exitWith {};

_housesScaned pushBack _houseBeingScaned;
_housesScanned pushBack _houseBeingScanned;

private _actionSet = [_typeOfHouse] call FUNC(userActions_getHouseActions);
private _actionSet = [typeOf _houseBeingScanned] call FUNC(userActions_getHouseActions);
_actionSet params ["_memPoints", "_memPointsActions"];

// systemChat format ["Add Actions for [%1] (count %2) @ %3", _typeOfHouse, (count _memPoints), diag_tickTime];
TRACE_3("Add Actions for [%1] (count %2) @ %3",typeOf _houseBeingScanned,(count _memPoints),diag_tickTime);
{
private _helperPos = _houseBeingScaned modelToWorldWorld (_houseBeingScaned selectionPosition _x);
private _helperPos = _houseBeingScanned modelToWorldWorld (_houseBeingScanned selectionPosition _x);
private _helperObject = "ACE_LogicDummy" createVehicleLocal [0,0,0];
_addedHelpers pushBack _helperObject;
_helperObject setVariable [QGVAR(building), _houseBeingScaned];
_helperObject setVariable [QGVAR(building), _houseBeingScanned];
_helperObject setPosASL _helperPos;
TRACE_3("Making New Helper",_helperObject,_x,_houseBeingScaned);
TRACE_3("Making New Helper",_helperObject,_x,_houseBeingScanned);

{
[_helperObject, 0, [], _x] call EFUNC(interact_menu,addActionToObject);
nil
} count (_memPointsActions select _forEachIndex);

} forEach (_memPointsActions select _forEachIndex);
} forEach _memPoints;
};
};
}, 0, [((getPosASL ace_player) vectorAdd [-100,0,0]), [], [], []]] call CBA_fnc_addPerFrameHandler;
}, 0, [((getPosASL ACE_player) vectorAdd [-100,0,0]), [], [], []]] call CBA_fnc_addPerFrameHandler;
8 changes: 4 additions & 4 deletions addons/killtracker/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ GVAR(killCount) = 0;

if (!isNull _killer) then {
if (!(_killer isKindof "CAManBase")) then { // If killer is a vehicle log the vehicle type
_killInfo pushBack format [LLSTRING(Vehicle), getText (configfile >> "CfgVehicles" >> (typeOf _killer) >> "displayName")];
_killInfo pushBack format [LLSTRING(Vehicle), getText ((configOf _killer) >> "displayName")];
};
if (isNull _instigator) then {
_instigator = effectiveCommander _killer;
Expand All @@ -82,7 +82,7 @@ GVAR(killCount) = 0;
// Log firendly fire
private _fnc_getSideFromConfig = {
params ["_object"];
switch (getNumber (configFile >> "CfgVehicles" >> (typeOf _object) >> "side")) do {
switch (getNumber ((configOf _object) >> "side")) do {
case (0): {east};
case (1): {west};
case (2): {resistance};
Expand Down Expand Up @@ -117,7 +117,7 @@ GVAR(killCount) = 0;
} else {
_killerName = _killer getVariable [QGVAR(aiName), ""]; // allow setting a custom AI name (e.g. VIP Target)
if (_killerName == "") then {
_killerName = format ["*AI* - %1", getText (configfile >> "CfgVehicles" >> (typeOf _killer) >> "displayName")];
_killerName = format ["*AI* - %1", getText ((configOf _killer) >> "displayName")];
};
};
};
Expand All @@ -133,7 +133,7 @@ GVAR(killCount) = 0;
} else {
_unitName = _unit getVariable [QGVAR(aiName), ""]; // allow setting a custom AI name (e.g. VIP Target)
if (_unitName == "") then {
_unitName = format ["*AI* - %1", getText (configfile >> "CfgVehicles" >> (typeOf _unit) >> "displayName")];
_unitName = format ["*AI* - %1", getText ((configOf _unit) >> "displayName")];
};
};
TRACE_3("send kill event",_killer,_unitName,_killInfo);
Expand Down
Loading

0 comments on commit 68ed199

Please sign in to comment.