summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/Entities/ArrowEntity.cpp5
-rw-r--r--src/Entities/ThrownSnowballEntity.cpp4
-rw-r--r--src/Items/ItemThrowable.h11
-rw-r--r--src/WorldStorage/NBTChunkSerializer.cpp1
4 files changed, 16 insertions, 5 deletions
diff --git a/src/Entities/ArrowEntity.cpp b/src/Entities/ArrowEntity.cpp
index fbc535e63..769750bd4 100644
--- a/src/Entities/ArrowEntity.cpp
+++ b/src/Entities/ArrowEntity.cpp
@@ -19,7 +19,10 @@ cArrowEntity::cArrowEntity(cEntity * a_Creator, double a_X, double a_Y, double a
m_bIsCollected(false),
m_HitBlockPos(Vector3i(0, 0, 0))
{
- SetPosY(GetPosY() + a_Creator->GetHeight() - 0.1000000014901161);
+ if (a_Creator != NULL)
+ {
+ SetPosY(GetPosY() + a_Creator->GetHeight() - 0.1000000014901161);
+ }
SetSpeed(a_Speed);
SetMass(0.1);
SetYawFromSpeed();
diff --git a/src/Entities/ThrownSnowballEntity.cpp b/src/Entities/ThrownSnowballEntity.cpp
index 427f630f7..cefc3433c 100644
--- a/src/Entities/ThrownSnowballEntity.cpp
+++ b/src/Entities/ThrownSnowballEntity.cpp
@@ -36,10 +36,6 @@ void cThrownSnowballEntity::OnHitEntity(cEntity & a_EntityHit, const Vector3d &
{
TotalDamage = 3;
}
- else if (MobType == cMonster::mtEnderDragon)
- {
- TotalDamage = 1;
- }
}
// TODO: If entity is Ender Crystal, destroy it
a_EntityHit.TakeDamage(dtRangedAttack, this, TotalDamage, 1);
diff --git a/src/Items/ItemThrowable.h b/src/Items/ItemThrowable.h
index 35c2b8731..25935a1bc 100644
--- a/src/Items/ItemThrowable.h
+++ b/src/Items/ItemThrowable.h
@@ -31,6 +31,17 @@ public:
Vector3d Pos = a_Player->GetThrowStartPos();
Vector3d Speed = a_Player->GetLookVector() * m_SpeedCoeff;
+ // Play sound
+ cFastRandom Random;
+ a_World->BroadcastSoundEffect(
+ "random.bow",
+ (int)std::floor(a_Player->GetPosX() * 8.0),
+ (int)std::floor((a_Player->GetPosY() - a_Player->GetHeight()) * 8.0),
+ (int)std::floor(a_Player->GetPosZ() * 8.0),
+ 0.5F,
+ 0.4F / (Random.NextFloat(1.0F) * 0.4F + 0.8F)
+ );
+
if (a_World->CreateProjectile(Pos.x, Pos.y, Pos.z, m_ProjectileKind, a_Player, a_Player->GetEquippedItem(), &Speed) < 0)
{
return false;
diff --git a/src/WorldStorage/NBTChunkSerializer.cpp b/src/WorldStorage/NBTChunkSerializer.cpp
index 7b7cd3c7e..cc1ffe8f9 100644
--- a/src/WorldStorage/NBTChunkSerializer.cpp
+++ b/src/WorldStorage/NBTChunkSerializer.cpp
@@ -608,6 +608,7 @@ void cNBTChunkSerializer::AddProjectileEntity(cProjectileEntity * a_Projectile)
case cProjectileEntity::pkGhastFireball:
{
m_Writer.AddInt("ExplosionPower", 1);
+ break;
// fall-through:
}
case cProjectileEntity::pkFireCharge: