summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2018-07-25 00:47:56 +0200
committerTiger Wang <ziwei.tiger@outlook.com>2018-07-25 16:29:26 +0200
commit74f5160332bbc151bbf94a1cceeb54b69b90161f (patch)
tree787435021454ad5f2124fdc082fafdb42ff5c26c
parentBroadcast refactor (#4264) (diff)
downloadcuberite-74f5160332bbc151bbf94a1cceeb54b69b90161f.tar
cuberite-74f5160332bbc151bbf94a1cceeb54b69b90161f.tar.gz
cuberite-74f5160332bbc151bbf94a1cceeb54b69b90161f.tar.bz2
cuberite-74f5160332bbc151bbf94a1cceeb54b69b90161f.tar.lz
cuberite-74f5160332bbc151bbf94a1cceeb54b69b90161f.tar.xz
cuberite-74f5160332bbc151bbf94a1cceeb54b69b90161f.tar.zst
cuberite-74f5160332bbc151bbf94a1cceeb54b69b90161f.zip
-rw-r--r--src/Entities/Pawn.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/Entities/Pawn.cpp b/src/Entities/Pawn.cpp
index fb650e586..65af67916 100644
--- a/src/Entities/Pawn.cpp
+++ b/src/Entities/Pawn.cpp
@@ -428,9 +428,14 @@ void cPawn::HandleFalling(void)
TakeDamage(dtFalling, nullptr, Damage, Damage, 0);
// 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)
- // int ParticleSize = static_cast<int>((std::min(15, Damage) - 1.f) * ((50.f - 20.f) / (15.f - 1.f)) + 20.f);
- // GetWorld()->BroadcastSoundParticleEffect(EffectID::PARTICLE_FALL_PARTICLES, POSX_TOINT, POSY_TOINT - 1, POSZ_TOINT, ParticleSize);
+ GetWorld()->BroadcastParticleEffect(
+ "blockdust",
+ 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;