1
0
Fork 0

Fixed indentations, removed redundant init code in SplashPotionEntity.cpp

This commit is contained in:
archshift 2014-07-20 13:11:06 -07:00
parent 0298d34406
commit 60d4a16514
4 changed files with 7 additions and 9 deletions

View File

@ -38,7 +38,7 @@ cEntityEffect::eType cEntityEffect::GetPotionEffectType(short a_ItemDamage)
case 0x0d: return cEntityEffect::effWaterBreathing;
case 0x0e: return cEntityEffect::effInvisibility;
// No effect potions
// No effect potions
case 0x00:
case 0x07:
case 0x0b: // Will be potion of leaping in 1.8

View File

@ -44,8 +44,7 @@ public:
static cEntityEffect::eType GetPotionEffectType(short a_ItemDamage);
/** Retrieves the intensity level from the potion's damage value.
Returns 0 for level I potions, 1 for level II potions. */
/** Retrieves the intensity level from the potion's damage value. Returns 0 for level I potions, 1 for level II potions. */
static short GetPotionEffectIntensity(short a_ItemDamage);

View File

@ -75,9 +75,6 @@ cSplashPotionEntity::cSplashPotionEntity(
cItem a_Item
) :
super(pkSplashPotion, a_Creator, a_X, a_Y, a_Z, 0.25, 0.25),
m_EntityEffectType(cEntityEffect::effNoEffect),
m_EntityEffect(cEntityEffect()),
m_PotionColor(0),
m_DestroyTimer(-1)
{
SetSpeed(a_Speed);

View File

@ -63,9 +63,11 @@ public:
return false;
}
a_Player->AddEntityEffect(cEntityEffect::GetPotionEffectType(PotionDamage),
cEntityEffect::GetPotionEffectDuration(PotionDamage),
cEntityEffect::GetPotionEffectIntensity(PotionDamage));
a_Player->AddEntityEffect(
cEntityEffect::GetPotionEffectType(PotionDamage),
cEntityEffect::GetPotionEffectDuration(PotionDamage),
cEntityEffect::GetPotionEffectIntensity(PotionDamage)
);
a_Player->GetInventory().RemoveOneEquippedItem();
a_Player->GetInventory().AddItem(E_ITEM_GLASS_BOTTLE);
return true;