From 0298d34406b1582e882795bf4d9d3fea18fd0135 Mon Sep 17 00:00:00 2001 From: archshift Date: Sun, 20 Jul 2014 02:56:59 -0700 Subject: Moved potion static functions to EntityEffect to create splash potions through world --- src/Entities/SplashPotionEntity.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src/Entities/SplashPotionEntity.cpp') diff --git a/src/Entities/SplashPotionEntity.cpp b/src/Entities/SplashPotionEntity.cpp index 6d874e957..d874a86e1 100644 --- a/src/Entities/SplashPotionEntity.cpp +++ b/src/Entities/SplashPotionEntity.cpp @@ -72,17 +72,21 @@ 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 + 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_EntityEffectType(cEntityEffect::effNoEffect), + m_EntityEffect(cEntityEffect()), + m_PotionColor(0), 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); } -- cgit v1.2.3