2015-04-20 11:54:22 +00:00
|
|
|
/*
|
2015-04-24 08:58:55 +00:00
|
|
|
* Author: ACE2 Team, Ruthberg
|
2015-04-20 11:54:22 +00:00
|
|
|
*
|
|
|
|
* Updates rain based on ACE_RAIN_PARAMS
|
|
|
|
*
|
|
|
|
* Argument:
|
|
|
|
* Nothing
|
|
|
|
*
|
|
|
|
* Return value:
|
|
|
|
* Nothing
|
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-04-24 08:03:48 +00:00
|
|
|
if (!GVAR(syncRain)) exitWith {};
|
2015-04-20 11:54:22 +00:00
|
|
|
|
2015-04-24 08:58:55 +00:00
|
|
|
if (!isNil "ACE_RAIN_PARAMS") then {
|
2015-08-04 00:11:24 +00:00
|
|
|
ACE_RAIN_PARAMS params ["_oldRain", "_newRain", "_period"];
|
|
|
|
|
2015-04-24 08:58:55 +00:00
|
|
|
private ["_periodPosition", "_periodPercent"];
|
2015-05-21 16:42:44 +00:00
|
|
|
_periodPosition = (ACE_time - GVAR(rain_period_start_time)) min _period;
|
2015-04-24 08:58:55 +00:00
|
|
|
_periodPercent = (_periodPosition / _period) min 1;
|
2015-04-20 11:54:22 +00:00
|
|
|
|
2015-06-07 16:57:16 +00:00
|
|
|
GVAR(ACE_Rain) = (_oldRain + (_newRain - _oldRain) * _periodPercent);
|
2015-04-20 11:54:22 +00:00
|
|
|
};
|