summaryrefslogtreecommitdiffstats
path: root/src/Entities/Entity.cpp
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-09-01 14:35:52 +0200
committermadmaxoft <github@xoft.cz>2014-09-01 14:35:52 +0200
commit8821c476bb57a7fe4f45b0ff755394faa378fbef (patch)
tree9c68ec6afa36dd0d15bcde2b1bcfc85ef2a1a8ee /src/Entities/Entity.cpp
parentFixed MSVC compilation, improved performance. (diff)
downloadcuberite-8821c476bb57a7fe4f45b0ff755394faa378fbef.tar
cuberite-8821c476bb57a7fe4f45b0ff755394faa378fbef.tar.gz
cuberite-8821c476bb57a7fe4f45b0ff755394faa378fbef.tar.bz2
cuberite-8821c476bb57a7fe4f45b0ff755394faa378fbef.tar.lz
cuberite-8821c476bb57a7fe4f45b0ff755394faa378fbef.tar.xz
cuberite-8821c476bb57a7fe4f45b0ff755394faa378fbef.tar.zst
cuberite-8821c476bb57a7fe4f45b0ff755394faa378fbef.zip
Diffstat (limited to '')
-rw-r--r--src/Entities/Entity.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp
index dde45c360..89d1cffa1 100644
--- a/src/Entities/Entity.cpp
+++ b/src/Entities/Entity.cpp
@@ -396,11 +396,11 @@ bool cEntity::DoTakeDamage(TakeDamageInfo & a_TDI)
}
int ThornsLevel = 0;
- const cItem * ArmorItems[] = { &GetEquippedHelmet(), &GetEquippedChestplate(), &GetEquippedLeggings(), &GetEquippedBoots() };
+ const cItem ArmorItems[] = { GetEquippedHelmet(), GetEquippedChestplate(), GetEquippedLeggings(), GetEquippedBoots() };
for (size_t i = 0; i < ARRAYCOUNT(ArmorItems); i++)
{
- const cItem * Item = ArmorItems[i];
- ThornsLevel = std::max(ThornsLevel, Item->m_Enchantments.GetLevel(cEnchantments::enchThorns));
+ const cItem & Item = ArmorItems[i];
+ ThornsLevel = std::max(ThornsLevel, Item.m_Enchantments.GetLevel(cEnchantments::enchThorns));
}
if (ThornsLevel > 0)
@@ -437,35 +437,35 @@ bool cEntity::DoTakeDamage(TakeDamageInfo & a_TDI)
double EPFProjectileProtection = 0.00;
double EPFFeatherFalling = 0.00;
- const cItem * ArmorItems[] = { &GetEquippedHelmet(), &GetEquippedChestplate(), &GetEquippedLeggings(), &GetEquippedBoots() };
+ const cItem ArmorItems[] = { GetEquippedHelmet(), GetEquippedChestplate(), GetEquippedLeggings(), GetEquippedBoots() };
for (size_t i = 0; i < ARRAYCOUNT(ArmorItems); i++)
{
- const cItem * Item = ArmorItems[i];
- int Level = Item->m_Enchantments.GetLevel(cEnchantments::enchProtection);
+ const cItem & Item = ArmorItems[i];
+ int Level = Item.m_Enchantments.GetLevel(cEnchantments::enchProtection);
if (Level > 0)
{
EPFProtection += (6 + Level * Level) * 0.75 / 3;
}
- Level = Item->m_Enchantments.GetLevel(cEnchantments::enchFireProtection);
+ Level = Item.m_Enchantments.GetLevel(cEnchantments::enchFireProtection);
if (Level > 0)
{
EPFFireProtection += (6 + Level * Level) * 1.25 / 3;
}
- Level = Item->m_Enchantments.GetLevel(cEnchantments::enchFeatherFalling);
+ Level = Item.m_Enchantments.GetLevel(cEnchantments::enchFeatherFalling);
if (Level > 0)
{
EPFFeatherFalling += (6 + Level * Level) * 2.5 / 3;
}
- Level = Item->m_Enchantments.GetLevel(cEnchantments::enchBlastProtection);
+ Level = Item.m_Enchantments.GetLevel(cEnchantments::enchBlastProtection);
if (Level > 0)
{
EPFBlastProtection += (6 + Level * Level) * 1.5 / 3;
}
- Level = Item->m_Enchantments.GetLevel(cEnchantments::enchProjectileProtection);
+ Level = Item.m_Enchantments.GetLevel(cEnchantments::enchProjectileProtection);
if (Level > 0)
{
EPFProjectileProtection += (6 + Level * Level) * 1.5 / 3;