From 45545825a44ffcbf70179d1dfd0fdff283f9bbe0 Mon Sep 17 00:00:00 2001 From: Spoike Date: Sun, 13 Apr 2014 18:21:04 +0000 Subject: [PATCH] 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 --- engine/client/p_script.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/engine/client/p_script.c b/engine/client/p_script.c index c7d96a783..2d99a3036 100644 --- a/engine/client/p_script.c +++ b/engine/client/p_script.c @@ -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);