2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2016-01-20 16:05:47 +00:00
|
|
|
/*
|
|
|
|
* Author: esteldunedain
|
2016-01-20 16:07:51 +00:00
|
|
|
* Update cooldown calculation of all player weapons at regular intervals.
|
2016-01-20 16:05:47 +00:00
|
|
|
*
|
2016-06-18 09:50:41 +00:00
|
|
|
* Arguments:
|
2016-01-20 16:05:47 +00:00
|
|
|
* None
|
|
|
|
*
|
2016-06-18 09:50:41 +00:00
|
|
|
* Return Value:
|
2016-01-20 16:05:47 +00:00
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [] call ace_overheating_fnc_updateTemperatureThread
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
2016-01-20 16:07:51 +00:00
|
|
|
|
2021-10-14 15:47:52 +00:00
|
|
|
if (ACE_player call EFUNC(common,isSwimming)) then { // cool off both weapons while swimming because currentWeapon == ""
|
|
|
|
private _primaryWeapon = primaryWeapon ACE_player;
|
|
|
|
private _handgunWeapon = handgunWeapon ACE_player;
|
|
|
|
if (_primaryWeapon != "") then {
|
|
|
|
[ACE_player, _primaryWeapon, 0] call FUNC(updateTemperature);
|
|
|
|
};
|
|
|
|
if (_handgunWeapon != "") then {
|
|
|
|
[ACE_player, _handgunWeapon, 0] call FUNC(updateTemperature);
|
|
|
|
};
|
|
|
|
} else {
|
|
|
|
private _currentWeapon = currentWeapon ACE_player;
|
|
|
|
if ((_currentWeapon != "") && {_currentWeapon == primaryWeapon ACE_player || {_currentWeapon == handgunWeapon ACE_player}}) then {
|
|
|
|
[ACE_player, _currentWeapon, 0] call FUNC(updateTemperature);
|
|
|
|
};
|
2016-01-20 16:05:47 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// Schedule for execution again after 5 seconds
|
2016-05-22 13:27:24 +00:00
|
|
|
[DFUNC(updateTemperatureThread), [], 5] call CBA_fnc_waitAndExecute;
|