summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2021-04-06 01:06:58 +0200
committerTiger Wang <ziwei.tiger@outlook.com>2021-04-12 23:35:07 +0200
commitd6b264bc21bc53c8bbc9fa8ae4c6eb7cab8eef9b (patch)
tree3665701dcb6b8af5ad0207615ed8c229247ccb22
parentFix sending incorrect date values on world change (diff)
downloadcuberite-d6b264bc21bc53c8bbc9fa8ae4c6eb7cab8eef9b.tar
cuberite-d6b264bc21bc53c8bbc9fa8ae4c6eb7cab8eef9b.tar.gz
cuberite-d6b264bc21bc53c8bbc9fa8ae4c6eb7cab8eef9b.tar.bz2
cuberite-d6b264bc21bc53c8bbc9fa8ae4c6eb7cab8eef9b.tar.lz
cuberite-d6b264bc21bc53c8bbc9fa8ae4c6eb7cab8eef9b.tar.xz
cuberite-d6b264bc21bc53c8bbc9fa8ae4c6eb7cab8eef9b.tar.zst
cuberite-d6b264bc21bc53c8bbc9fa8ae4c6eb7cab8eef9b.zip
Diffstat (limited to '')
-rw-r--r--src/Entities/Pawn.cpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/Entities/Pawn.cpp b/src/Entities/Pawn.cpp
index a58c1dc40..ef552d89d 100644
--- a/src/Entities/Pawn.cpp
+++ b/src/Entities/Pawn.cpp
@@ -425,15 +425,18 @@ void cPawn::HandleFalling(void)
TakeDamage(dtFalling, nullptr, Damage, static_cast<float>(Damage), 0);
- // Fall particles
- 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 } }
- );
+ // Fall particles:
+ if (const auto Below = POS_TOINT.addedY(-1); Below.y >= 0)
+ {
+ 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(Below), 0 } }
+ );
+ }
}
m_bTouchGround = true;