From fe59fe870376a858ff1c61c857c87f7311c3ad47 Mon Sep 17 00:00:00 2001 From: Titus Tscharntke Date: Sun, 15 Apr 2012 22:38:41 +0000 Subject: [PATCH] Bugfix: particles are also colored with daylight effect if they are created. ( if isDaylightAffected is set ) --- source/shared_lib/sources/graphics/particle.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/shared_lib/sources/graphics/particle.cpp b/source/shared_lib/sources/graphics/particle.cpp index e33cb41a..4e91c962 100644 --- a/source/shared_lib/sources/graphics/particle.cpp +++ b/source/shared_lib/sources/graphics/particle.cpp @@ -997,6 +997,12 @@ void UnitParticleSystem::initParticle(Particle *p, int particleIndex){ const float radRatio= sqrtf(mod / radius); #endif p->color= color; + if(isDaylightAffected==true) + { + p->color.x=p->color.x*lightColor.x; + p->color.y=p->color.y*lightColor.y; + p->color.z=p->color.z*lightColor.z; + } if(radiusBasedStartenergy == true){ p->energy= static_cast (maxParticleEnergy * radRatio) + random.randRange(-varParticleEnergy, varParticleEnergy);