@@ -244,7 +244,6 @@ BOOL CEffect_Thunderbolt::RayPick(const Fvector& s, const Fvector& d, float& dis
244244
245245 return bRes;
246246}
247- #define FAR_DIST g_pGamePersistent->Environment ().CurrentEnv->far_plane
248247
249248void CEffect_Thunderbolt::Bolt (shared_str id, float period, float lt)
250249{
@@ -256,14 +255,16 @@ void CEffect_Thunderbolt::Bolt(shared_str id, float period, float lt)
256255 current = g_pGamePersistent->Environment ().thunderbolt_collection (collection, id)->GetRandomDesc ();
257256 VERIFY (current);
258257
258+ float far_plane = g_pGamePersistent->Environment ().CurrentEnv ->far_plane ;
259+
259260 Fmatrix XF, S;
260261 Fvector pos, dev;
261262 float sun_h, sun_p;
262263 CEnvironment& environment = g_pGamePersistent->Environment ();
263264 environment.CurrentEnv ->sun_dir .getHP (sun_h, sun_p);
264265 float alt = environment.p_var_alt ; // Random.randF(environment.p_var_alt.x,environment.p_var_alt.y);
265266 float lng = Random.randF (sun_h - environment.p_var_long + PI, sun_h + environment.p_var_long + PI);
266- float dist = Random.randF (FAR_DIST * environment.p_min_dist , FAR_DIST * .95f );
267+ float dist = Random.randF (far_plane * environment.p_min_dist , far_plane * .95f );
267268 current_direction.setHP (lng, alt);
268269 pos.mad (Device.vCameraPosition , current_direction, dist);
269270 dev.x = Random.randF (-environment.p_tilt , environment.p_tilt );
@@ -273,7 +274,7 @@ void CEffect_Thunderbolt::Bolt(shared_str id, float period, float lt)
273274
274275 Fvector light_dir = {0 .f , -1 .f , 0 .f };
275276 XF.transform_dir (light_dir);
276- lightning_size = FAR_DIST * 2 .f ;
277+ lightning_size = far_plane * 2 .f ;
277278 RayPick (pos, light_dir, lightning_size);
278279
279280 lightning_center.mad (pos, light_dir, lightning_size * 0 .5f );
0 commit comments