overheating: change addPerFrameHandler to waitAndExecute

This commit is contained in:
Nicolás Badano 2015-01-17 03:13:05 -03:00
parent fefb599a55
commit a7e016fa8f
3 changed files with 4 additions and 11 deletions

View File

@ -3,8 +3,8 @@
PREP(checkTemperature);
PREP(clearJam);
PREP(cooldown);
PREP(displayTemperature);
PREP(jamWeapon);
PREP(overheat);
PREP(pfhDisplayTemperature);
PREP(swapBarrel);
PREP(swapBarrelCallback);

View File

@ -25,4 +25,4 @@ if (_action == "") then {
_player playActionNow _action;
// Launch a PFH that waits a sec before displaying the temperature
[FUNC(pfhDisplayTemperature), 1.0, [_player, _weapon, diag_tickTime]] call CBA_fnc_addPerFrameHandler;
[FUNC(displayTemperature), [_player, _weapon], 1.0, 0] call EFUNC(common,waitAndExecute);

View File

@ -1,7 +1,7 @@
/*
* Author: Commy2 and CAA-Picard
*
* PFH that displays the weapon temperature after a slight delay
* Displays the weapon temperature
*
* Arguments:
* 0: _player
@ -13,14 +13,7 @@
*/
#include "\z\ace\addons\overheating\script_component.hpp"
EXPLODE_2_PVT(_this,_params,_pfhId);
EXPLODE_3_PVT(_params,_player,_weapon,_startTime);
// Skip the first execution of the PFH
if (diag_tickTime < _startTime + 0.5) exitWith {};
// Remove the PFH on the second execution
[_pfhId] call cba_fnc_removePerFrameHandler;
EXPLODE_2_PVT(_this,_player,_weapon);
// Calculate cool down of weapon since last shot
private ["_string", "_overheat", "_temperature", "_time", "_barrelMass"];