From c09764b3fd70d6aeee8196e99a5bcddbac4e5b7b Mon Sep 17 00:00:00 2001 From: David Dormagen Date: Fri, 26 Sep 2014 21:32:08 +0200 Subject: [PATCH] fixed CreateParticleAtBone (would create particles at a wrong position) Also set "amount" to min. 1 because that's what intuition would dictate. --- src/object/C4ObjectScript.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/object/C4ObjectScript.cpp b/src/object/C4ObjectScript.cpp index 574ebfaff..9e8511a65 100644 --- a/src/object/C4ObjectScript.cpp +++ b/src/object/C4ObjectScript.cpp @@ -2280,6 +2280,10 @@ static bool FnCreateParticleAtBone(C4Object* Obj, C4String* szName, C4String* sz const float dy = ty + ry*thgt; x.x += dx; x.y += dy; + // This was added in the block before and could also just be removed from tx/ty. + // However, the block would no longer be equal to where it came from. + x.x -= fixtof(Obj->fix_x); + x.y -= fixtof(Obj->fix_y); // Finally, apply DrawTransform to the world coordinates StdMeshMatrix DrawTransform; if(Obj->pDrawTransform) @@ -2318,6 +2322,7 @@ static bool FnCreateParticleAtBone(C4Object* Obj, C4String* szName, C4String* sz valueLifetime.Set(lifetime); // cast + if (amount < 1) amount = 1; ::Particles.Create(pDef, valueX, valueY, valueSpeedX, valueSpeedY, valueLifetime, properties, amount, Obj); #endif // success, even if not created