try to correct decal positions so small ones work a little more reliably (only when no orientation is specified).

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4641 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2014-04-13 18:21:04 +00:00
parent 15caf097af
commit 45545825a4

View file

@ -3343,7 +3343,7 @@ static int PScript_RunParticleEffectState (vec3_t org, vec3_t dir, float count,
trace_t tr;
float sb,sw,tb,tw;
vec3_t bestdir;
vec3_t bestdir, bestorg;
if (!free_decals)
return 0;
@ -3354,6 +3354,7 @@ static int PScript_RunParticleEffectState (vec3_t org, vec3_t dir, float count,
bestdir[1] = 0.73;
bestdir[2] = 0.73;
dist = 1;
VectorCopy(org, bestorg);
for (i = 0; i < 6; i++)
{
if (i >= 3)
@ -3377,10 +3378,12 @@ static int PScript_RunParticleEffectState (vec3_t org, vec3_t dir, float count,
{
dist = tr.fraction;
VectorCopy(tr.plane.normal, bestdir);
VectorCopy(tr.endpos, bestorg);
}
}
}
dir = bestdir;
org = bestorg;
}
VectorInverse(dir);
VectorNormalize(dir);