forked from Mirrors/openclonk
fixed CreateParticleAtBone (would create particles at a wrong position)
Also set "amount" to min. 1 because that's what intuition would dictate.issue1247
parent
7d5f2effb4
commit
c09764b3fd
|
@ -2280,6 +2280,10 @@ static bool FnCreateParticleAtBone(C4Object* Obj, C4String* szName, C4String* sz
|
||||||
const float dy = ty + ry*thgt;
|
const float dy = ty + ry*thgt;
|
||||||
x.x += dx;
|
x.x += dx;
|
||||||
x.y += dy;
|
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
|
// Finally, apply DrawTransform to the world coordinates
|
||||||
StdMeshMatrix DrawTransform;
|
StdMeshMatrix DrawTransform;
|
||||||
if(Obj->pDrawTransform)
|
if(Obj->pDrawTransform)
|
||||||
|
@ -2318,6 +2322,7 @@ static bool FnCreateParticleAtBone(C4Object* Obj, C4String* szName, C4String* sz
|
||||||
valueLifetime.Set(lifetime);
|
valueLifetime.Set(lifetime);
|
||||||
|
|
||||||
// cast
|
// cast
|
||||||
|
if (amount < 1) amount = 1;
|
||||||
::Particles.Create(pDef, valueX, valueY, valueSpeedX, valueSpeedY, valueLifetime, properties, amount, Obj);
|
::Particles.Create(pDef, valueX, valueY, valueSpeedX, valueSpeedY, valueLifetime, properties, amount, Obj);
|
||||||
#endif
|
#endif
|
||||||
// success, even if not created
|
// success, even if not created
|
||||||
|
|
Loading…
Reference in New Issue