summaryrefslogtreecommitdiffstats
path: root/src/MonsterConfig.cpp
diff options
context:
space:
mode:
authorTycho <work.tycho+git@gmail.com>2014-01-26 15:28:51 +0100
committerTycho <work.tycho+git@gmail.com>2014-01-26 15:28:51 +0100
commitbed2ee22e8283a2e8bd0790a89124839319c2fc3 (patch)
treeee9e66a7b7c63995797a502f209079c1422ce9c9 /src/MonsterConfig.cpp
parentRefactored cBlockHandler::OnUse and dependents (diff)
parentMerge pull request #589 from mc-server/minecartimprovements (diff)
downloadcuberite-bed2ee22e8283a2e8bd0790a89124839319c2fc3.tar
cuberite-bed2ee22e8283a2e8bd0790a89124839319c2fc3.tar.gz
cuberite-bed2ee22e8283a2e8bd0790a89124839319c2fc3.tar.bz2
cuberite-bed2ee22e8283a2e8bd0790a89124839319c2fc3.tar.lz
cuberite-bed2ee22e8283a2e8bd0790a89124839319c2fc3.tar.xz
cuberite-bed2ee22e8283a2e8bd0790a89124839319c2fc3.tar.zst
cuberite-bed2ee22e8283a2e8bd0790a89124839319c2fc3.zip
Diffstat (limited to '')
-rw-r--r--src/MonsterConfig.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/MonsterConfig.cpp b/src/MonsterConfig.cpp
index 6165606f0..c06bd6b6f 100644
--- a/src/MonsterConfig.cpp
+++ b/src/MonsterConfig.cpp
@@ -12,9 +12,9 @@
struct cMonsterConfig::sAttributesStruct
{
AString m_Name;
- double m_SightDistance;
- double m_AttackDamage;
- double m_AttackRange;
+ int m_SightDistance;
+ int m_AttackDamage;
+ int m_AttackRange;
double m_AttackRate;
int m_MaxHealth;
};
@@ -67,9 +67,9 @@ void cMonsterConfig::Initialize()
sAttributesStruct Attributes;
AString Name = MonstersIniFile.GetKeyName(i);
Attributes.m_Name = Name;
- Attributes.m_AttackDamage = MonstersIniFile.GetValueF(Name, "AttackDamage", 0);
- Attributes.m_AttackRange = MonstersIniFile.GetValueF(Name, "AttackRange", 0);
- Attributes.m_SightDistance = MonstersIniFile.GetValueF(Name, "SightDistance", 0);
+ Attributes.m_AttackDamage = MonstersIniFile.GetValueI(Name, "AttackDamage", 0);
+ Attributes.m_AttackRange = MonstersIniFile.GetValueI(Name, "AttackRange", 0);
+ Attributes.m_SightDistance = MonstersIniFile.GetValueI(Name, "SightDistance", 0);
Attributes.m_AttackRate = MonstersIniFile.GetValueF(Name, "AttackRate", 0);
Attributes.m_MaxHealth = MonstersIniFile.GetValueI(Name, "MaxHealth", 1);
m_pState->AttributesList.push_front(Attributes);
@@ -87,10 +87,10 @@ void cMonsterConfig::AssignAttributes(cMonster * a_Monster, const AString & a_Na
{
if (itr->m_Name.compare(a_Name) == 0)
{
- a_Monster->SetAttackDamage ((float)itr->m_AttackDamage);
- a_Monster->SetAttackRange ((float)itr->m_AttackRange);
- a_Monster->SetSightDistance((float)itr->m_SightDistance);
- a_Monster->SetAttackRate ((int)itr->m_AttackRate);
+ a_Monster->SetAttackDamage (itr->m_AttackDamage);
+ a_Monster->SetAttackRange (itr->m_AttackRange);
+ a_Monster->SetSightDistance(itr->m_SightDistance);
+ a_Monster->SetAttackRate ((float)itr->m_AttackRate);
a_Monster->SetMaxHealth (itr->m_MaxHealth);
return;
}