mirror of
https://github.com/IT07/a3_vemf_reloaded.git
synced 2024-08-30 16:52:11 +00:00
Speed improvements
This commit is contained in:
parent
48d8662168
commit
c89fda96a2
@ -2,7 +2,7 @@
|
||||
VEMF AI Killed by Vampire, rewritten by IT07
|
||||
|
||||
Description:
|
||||
removes launchers if desired and announces the kill if enabled in config.cpp
|
||||
executed upon AI unit death
|
||||
|
||||
Params:
|
||||
_this: ARRAY
|
||||
@ -13,26 +13,19 @@
|
||||
nothing
|
||||
*/
|
||||
|
||||
if (_this isEqualType []) then
|
||||
{
|
||||
_target = param [0, objNull, [objNull]];
|
||||
_killer = param [1, objNull, [objNull]];
|
||||
if not(isNull _target AND isNull _killer) then
|
||||
{
|
||||
if isPlayer _killer then // Only allow this function to work if killer is an actual player
|
||||
{
|
||||
if (_killer isKindOf "Man") then // Roadkill or regular kill
|
||||
{
|
||||
if (vehicle _killer isEqualTo _killer) then // If on foot
|
||||
{
|
||||
if (vehicle _target isEqualTo _target) then
|
||||
{
|
||||
[_target, _killer] ExecVM "exile_vemf_reloaded\sqf\handleRespectGain.sqf";
|
||||
_sayKilled = "sayKilled" call VEMFr_fnc_getSetting;
|
||||
if (_sayKilled > 0) then // Send kill message if enabled
|
||||
if (("respectReward" call VEMFr_fnc_getSetting) > 0) then
|
||||
{
|
||||
[_target, _killer, _sayKilled] ExecVM "exile_vemf_reloaded\sqf\sayKilledWeapon.sqf";
|
||||
[_target, _killer] ExecVM "exile_vemf_reloaded\sqf\handleRespectGain.sqf";
|
||||
};
|
||||
[_target, _killer] ExecVM "exile_vemf_reloaded\sqf\sayKilledWeapon.sqf";
|
||||
} else
|
||||
{
|
||||
if (typeOf (vehicle _target) isEqualTo "Steerable_Parachute_F") then
|
||||
@ -43,12 +36,11 @@ if (_this isEqualType []) then
|
||||
};
|
||||
} else
|
||||
{
|
||||
[_target, _killer] ExecVM "exile_vemf_reloaded\sqf\handleRespectGain.sqf";
|
||||
_sayKilled = "sayKilled" call VEMFr_fnc_getSetting;
|
||||
if (_sayKilled > 0) then // Send kill message if enabled
|
||||
if (("respectReward" call VEMFr_fnc_getSetting) > 0) then
|
||||
{
|
||||
[_target, _killer, _sayKilled] ExecVM "exile_vemf_reloaded\sqf\sayKilledWeapon.sqf";
|
||||
[_target, _killer] ExecVM "exile_vemf_reloaded\sqf\handleRespectGain.sqf";
|
||||
};
|
||||
[_target, _killer] ExecVM "exile_vemf_reloaded\sqf\sayKilledWeapon.sqf";
|
||||
};
|
||||
};
|
||||
} else // If in vehicle (a.k.a. roadkill)
|
||||
@ -68,8 +60,7 @@ if (_this isEqualType []) then
|
||||
|
||||
if (("sayKilled" call VEMFr_fnc_getSetting) isEqualTo 1) then
|
||||
{
|
||||
_kMsg = format["(VEMFr) %1 [Roadkill] AI", name _killer];
|
||||
[_kMsg, [], "sys"] ExecVM "exile_vemf_reloaded\sqf\broadcast.sqf";
|
||||
[format["(VEMFr) %1 [Roadkill] AI", name _killer]] ExecVM "exile_vemf_reloaded\sqf\systemChatToClient.sqf";
|
||||
};
|
||||
};
|
||||
};
|
||||
@ -84,13 +75,11 @@ if (_this isEqualType []) then
|
||||
} else
|
||||
{
|
||||
_killer = effectiveCommander _killer;
|
||||
[_target, _killer] ExecVM "exile_vemf_reloaded\sqf\handleRespectGain.sqf";
|
||||
_sayKilled = "sayKilled" call VEMFr_fnc_getSetting;
|
||||
if (_sayKilled > 0) then // Send kill message if enabled
|
||||
if (("respectReward" call VEMFr_fnc_getSetting) > 0) then
|
||||
{
|
||||
[_target, _killer, _sayKilled] ExecVM "exile_vemf_reloaded\sqf\sayKilledWeapon.sqf";
|
||||
};
|
||||
[_target, _killer] ExecVM "exile_vemf_reloaded\sqf\handleRespectGain.sqf";
|
||||
};
|
||||
[_target, _killer] ExecVM "exile_vemf_reloaded\sqf\sayKilledWeapon.sqf";
|
||||
};
|
||||
};
|
||||
|
||||
@ -111,7 +100,6 @@ if (_this isEqualType []) then
|
||||
} forEach (magazines _target);
|
||||
};
|
||||
};
|
||||
|
||||
if (_settings select 2 isEqualTo 1) then // If removeHeadGear setting is enabled
|
||||
{
|
||||
removeHeadGear _target;
|
||||
@ -138,8 +126,3 @@ if (_this isEqualType []) then
|
||||
};
|
||||
|
||||
_target removeAllEventHandlers "MPKilled";
|
||||
} else
|
||||
{
|
||||
["fn_aiKilled", 0, "_target or _killer isNull"] ExecVM "exile_vemf_reloaded\sqf\log.sqf";
|
||||
};
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user