mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Apply the ufeh to ACE_Overheating
This commit is contained in:
parent
5b3df2bcf7
commit
5aa763f0c6
@ -10,14 +10,6 @@ class Extended_PostInit_EventHandlers {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
class Extended_FiredBIS_EventHandlers {
|
|
||||||
class CAManBase {
|
|
||||||
class GVAR(Overheat) {
|
|
||||||
clientFiredBIS = QUOTE(_this call FUNC(firedEH));
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
class Extended_Take_EventHandlers {
|
class Extended_Take_EventHandlers {
|
||||||
class CAManBase {
|
class CAManBase {
|
||||||
class GVAR(UnjamReload) {
|
class GVAR(UnjamReload) {
|
||||||
|
@ -36,3 +36,12 @@ GVAR(cacheWeaponData) setText QGVAR(cacheWeaponData);
|
|||||||
|
|
||||||
// Schedule cool down calculation of player weapons at (infrequent) regular intervals
|
// Schedule cool down calculation of player weapons at (infrequent) regular intervals
|
||||||
[] call FUNC(updateTemperatureThread);
|
[] call FUNC(updateTemperatureThread);
|
||||||
|
|
||||||
|
["SettingsInitialized", {
|
||||||
|
// Register fire event handler
|
||||||
|
["firedPlayer", DFUNC(firedEH)] call EFUNC(common,addEventHandler);
|
||||||
|
// Only add eh to non local players if dispersion is enabled
|
||||||
|
if (GVAR(overheatingDispersion)) then {
|
||||||
|
["firedPlayerNonLocal", DFUNC(firedEH)] call EFUNC(common,addEventHandler);
|
||||||
|
};
|
||||||
|
}] call EFUNC(common,addEventHandler);
|
||||||
|
@ -1,15 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
* Author: Commy2 and esteldunedain
|
* Author: Commy2 and esteldunedain
|
||||||
* Handle weapon fire
|
* Handle weapon fire. Called from the unified fired EH 1- always for the local player 2- and for non local players if dispersion is simulated.
|
||||||
*
|
*
|
||||||
* Argument:
|
* Argument:
|
||||||
* 0: unit - Object the event handler is assigned to <OBJECT>
|
* None. Parameters inherited from EFUNC(common,firedEH)
|
||||||
* 1: weapon - Fired weapon <STRING>
|
|
||||||
* 2: muzzle - Muzzle that was used <STRING>
|
|
||||||
* 3: mode - Current mode of the fired weapon <STRING>
|
|
||||||
* 4: ammo - Ammo used <STRING>
|
|
||||||
* 5: magazine - magazine name which was used <STRING>
|
|
||||||
* 6: projectile - Object of the projectile that was shot <OBJECT>
|
|
||||||
*
|
*
|
||||||
* Return value:
|
* Return value:
|
||||||
* None
|
* None
|
||||||
@ -18,15 +12,13 @@
|
|||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
//IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle", "_gunner", "_turret"];
|
||||||
|
TRACE_10("firedEH:",_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile, _vehicle, _gunner, _turret);
|
||||||
|
|
||||||
BEGIN_COUNTER(firedEH);
|
BEGIN_COUNTER(firedEH);
|
||||||
|
|
||||||
params ["_unit", "_weapon", "_muzzle", "", "_ammo", "", "_projectile"];
|
if ((_unit distance ACE_player) > 3000 //Ignore far away shots
|
||||||
TRACE_5("params",_unit,_weapon,_muzzle,_ammo,_projectile);
|
|| {(_muzzle != (primaryWeapon _unit)) && {_muzzle != (handgunWeapon _unit)}}) exitWith { // Only rifle or pistol muzzles (ignore grenades / GLs)
|
||||||
|
|
||||||
if (((!GVAR(overheatingDispersion)) && {_unit != ACE_player}) //If no dispersion, only run when local
|
|
||||||
|| {!([_unit] call EFUNC(common,isPlayer))} //Ignore AI
|
|
||||||
|| {(_unit distance ACE_player) > 3000} //Ignore far away shots
|
|
||||||
|| {(_muzzle != (primaryWeapon _unit)) && {_muzzle != (handgunWeapon _unit)}}) exitWith { // Only rifle or pistol muzzles (ignore grenades / GLs)
|
|
||||||
END_COUNTER(firedEH);
|
END_COUNTER(firedEH);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user