From f9b7e3c6f7045be5e901fcf6ac4265564d7a22c4 Mon Sep 17 00:00:00 2001 From: ulteq Date: Sat, 16 May 2015 21:10:34 +0200 Subject: [PATCH] Fixed clashing MACRO names --- addons/weather/functions/fnc_calculateDewPoint.sqf | 2 ++ addons/weather/functions/fnc_calculateHeatIndex.sqf | 4 ++-- addons/weather/script_component.hpp | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/addons/weather/functions/fnc_calculateDewPoint.sqf b/addons/weather/functions/fnc_calculateDewPoint.sqf index c5de883090..76656b1f55 100644 --- a/addons/weather/functions/fnc_calculateDewPoint.sqf +++ b/addons/weather/functions/fnc_calculateDewPoint.sqf @@ -20,6 +20,8 @@ PARAMS_2(_t,_rh); +if (_rh == 0) exitWith { CELSIUS(0) }; + // Source: https://en.wikipedia.org/wiki/Dew_point private ["_gamma"]; diff --git a/addons/weather/functions/fnc_calculateHeatIndex.sqf b/addons/weather/functions/fnc_calculateHeatIndex.sqf index 085edcd1a9..473360c867 100644 --- a/addons/weather/functions/fnc_calculateHeatIndex.sqf +++ b/addons/weather/functions/fnc_calculateHeatIndex.sqf @@ -28,7 +28,7 @@ PARAMS_2(_t,_rh); // Source: https://en.wikipedia.org/wiki/Heat_index -_t = FAHRENHEIT(_t); +_t = TO_FAHRENHEIT(_t); _rh = _rh * 100; // relative humidity in % -CELSIUS(__C1 + __C2 * _t + __C3 * _rh + __C4 * _t * _rh + __C5 * _t^2 + __C6 * _rh^2 + __C7 * _t^2 * _rh + __C8 * _t * _rh^2) +TO_CELSIUS(__C1 + __C2 * _t + __C3 * _rh + __C4 * _t * _rh + __C5 * _t^2 + __C6 * _rh^2 + __C7 * _t^2 * _rh + __C8 * _t * _rh^2) diff --git a/addons/weather/script_component.hpp b/addons/weather/script_component.hpp index dedfc59236..2a6aeb0393 100644 --- a/addons/weather/script_component.hpp +++ b/addons/weather/script_component.hpp @@ -18,5 +18,5 @@ #define WATER_VAPOR_MOLAR_MASS 0.018016 #define DRY_AIR_MOLAR_MASS 0.028964 #define SPECIFIC_GAS_CONSTANT_DRY_AIR 287.058 -#define CELSIUS(t) ((t - 32) / 1.8) -#define FAHRENHEIT(t) (t * 1.8 + 32) +#define TO_CELSIUS(t) ((t - 32) / 1.8) +#define TO_FAHRENHEIT(t) (t * 1.8 + 32)