summaryrefslogtreecommitdiffstats
path: root/src/Entities/SplashPotionEntity.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-07-26 16:47:11 +0200
committerMattes D <github@xoft.cz>2014-07-26 16:47:11 +0200
commit56f417494390ade84dd64167b1d62d28068b790c (patch)
tree7db4a59db1874bf9250e8c2c9bf3271e5a5ae67c /src/Entities/SplashPotionEntity.cpp
parentMerge pull request #1207 from Howaner/Inventory (diff)
parentSplashPotionEntity: Use `const cItem &` instead of a cItem (diff)
downloadcuberite-56f417494390ade84dd64167b1d62d28068b790c.tar
cuberite-56f417494390ade84dd64167b1d62d28068b790c.tar.gz
cuberite-56f417494390ade84dd64167b1d62d28068b790c.tar.bz2
cuberite-56f417494390ade84dd64167b1d62d28068b790c.tar.lz
cuberite-56f417494390ade84dd64167b1d62d28068b790c.tar.xz
cuberite-56f417494390ade84dd64167b1d62d28068b790c.tar.zst
cuberite-56f417494390ade84dd64167b1d62d28068b790c.zip
Diffstat (limited to 'src/Entities/SplashPotionEntity.cpp')
-rw-r--r--src/Entities/SplashPotionEntity.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/Entities/SplashPotionEntity.cpp b/src/Entities/SplashPotionEntity.cpp
index 6d874e957..fd1a0179b 100644
--- a/src/Entities/SplashPotionEntity.cpp
+++ b/src/Entities/SplashPotionEntity.cpp
@@ -72,17 +72,18 @@ cSplashPotionEntity::cSplashPotionEntity(
cEntity * a_Creator,
double a_X, double a_Y, double a_Z,
const Vector3d & a_Speed,
- cEntityEffect::eType a_EntityEffectType,
- cEntityEffect a_EntityEffect,
- int a_PotionColor
+ const cItem & a_Item
) :
super(pkSplashPotion, a_Creator, a_X, a_Y, a_Z, 0.25, 0.25),
- m_EntityEffectType(a_EntityEffectType),
- m_EntityEffect(a_EntityEffect),
- m_PotionColor(a_PotionColor),
m_DestroyTimer(-1)
{
SetSpeed(a_Speed);
+ m_EntityEffectType = cEntityEffect::GetPotionEffectType(a_Item.m_ItemDamage);
+ m_EntityEffect = cEntityEffect(
+ cEntityEffect::GetPotionEffectDuration(a_Item.m_ItemDamage),
+ cEntityEffect::GetPotionEffectIntensity(a_Item.m_ItemDamage)
+ );
+ m_PotionColor = cEntityEffect::GetPotionColor(a_Item.m_ItemDamage);
}