summaryrefslogtreecommitdiffstats
path: root/src/Entities/SplashPotionEntity.cpp
diff options
context:
space:
mode:
authorarchshift <admin@archshift.com>2014-06-13 11:41:43 +0200
committerarchshift <admin@archshift.com>2014-06-17 20:39:22 +0200
commit9e8361976b6b0dc4c62ef48a4744ba1f59fe4346 (patch)
treef474d56be32cc0d830b95f0d1283d8b1ee43b212 /src/Entities/SplashPotionEntity.cpp
parentChanged the AddEntityEffect() params for easier calls. (diff)
downloadcuberite-9e8361976b6b0dc4c62ef48a4744ba1f59fe4346.tar
cuberite-9e8361976b6b0dc4c62ef48a4744ba1f59fe4346.tar.gz
cuberite-9e8361976b6b0dc4c62ef48a4744ba1f59fe4346.tar.bz2
cuberite-9e8361976b6b0dc4c62ef48a4744ba1f59fe4346.tar.lz
cuberite-9e8361976b6b0dc4c62ef48a4744ba1f59fe4346.tar.xz
cuberite-9e8361976b6b0dc4c62ef48a4744ba1f59fe4346.tar.zst
cuberite-9e8361976b6b0dc4c62ef48a4744ba1f59fe4346.zip
Diffstat (limited to '')
-rw-r--r--src/Entities/SplashPotionEntity.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/Entities/SplashPotionEntity.cpp b/src/Entities/SplashPotionEntity.cpp
index 4035b4794..714e4021d 100644
--- a/src/Entities/SplashPotionEntity.cpp
+++ b/src/Entities/SplashPotionEntity.cpp
@@ -68,7 +68,7 @@ cSplashPotionEntity::cSplashPotionCallback::cSplashPotionCallback(const Vector3d
bool cSplashPotionEntity::cSplashPotionCallback::Item(cEntity * a_Entity)
{
double SplashDistance = (a_Entity->GetPosition() - m_HitPos).Length();
- if (SplashDistance < 20)
+ if (SplashDistance < 20 && a_Entity->IsPawn())
{
// y = -0.25x + 1, where x is the distance from the player. Approximation for potion splash.
// TODO: better equation
@@ -78,10 +78,8 @@ bool cSplashPotionEntity::cSplashPotionCallback::Item(cEntity * a_Entity)
Reduction = 0;
}
- if (a_Entity->IsPawn())
- {
- ((cPawn *) a_Entity)->AddEntityEffect(m_EntityEffectType, m_EntityEffect.m_Ticks, m_EntityEffect.GetIntensity(), Reduction);
- }
+ m_EntityEffect.SetDistanceModifier(Reduction);
+ ((cPawn *) a_Entity)->AddEntityEffect(m_EntityEffectType, m_EntityEffect);
}
return false;
}