1
0

Reimplemented fall particles

Regression when 1.9.x support introduced in #3135, originally implemented in #461.
This commit is contained in:
Tiger Wang 2018-07-24 23:47:56 +01:00
parent c94d7184eb
commit 74f5160332

View File

@ -428,9 +428,14 @@ void cPawn::HandleFalling(void)
TakeDamage(dtFalling, nullptr, Damage, Damage, 0); TakeDamage(dtFalling, nullptr, Damage, Damage, 0);
// Fall particles // Fall particles
// TODO: Re-enable this when effects in 1.9 aren't broken (right now this uses the wrong effect ID in 1.9 and the right one in 1.8) GetWorld()->BroadcastParticleEffect(
// int ParticleSize = static_cast<int>((std::min(15, Damage) - 1.f) * ((50.f - 20.f) / (15.f - 1.f)) + 20.f); "blockdust",
// GetWorld()->BroadcastSoundParticleEffect(EffectID::PARTICLE_FALL_PARTICLES, POSX_TOINT, POSY_TOINT - 1, POSZ_TOINT, ParticleSize); GetPosition(),
{ 0, 0, 0 },
(Damage - 1.f) * ((0.3f - 0.1f) / (15.f - 1.f)) + 0.1f, // Map damage (1 - 15) to particle speed (0.1 - 0.3)
static_cast<int>((Damage - 1.f) * ((50.f - 20.f) / (15.f - 1.f)) + 20.f), // Map damage (1 - 15) to particle quantity (20 - 50)
{ { GetWorld()->GetBlock(POS_TOINT - Vector3i(0, 1, 0)), 0 } }
);
} }
m_bTouchGround = true; m_bTouchGround = true;