summaryrefslogtreecommitdiffstats
path: root/source/cMonsterConfig.cpp
diff options
context:
space:
mode:
authorlapayo94@gmail.com <lapayo94@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2011-12-28 03:10:05 +0100
committerlapayo94@gmail.com <lapayo94@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2011-12-28 03:10:05 +0100
commit1e9af56a67ae3765291361d9bf01e9009cfb4dcc (patch)
tree65878a8c373ec163eed3439b7db0fc440810d95b /source/cMonsterConfig.cpp
parentFixed some things in Core to work for multiple worlds (diff)
downloadcuberite-1e9af56a67ae3765291361d9bf01e9009cfb4dcc.tar
cuberite-1e9af56a67ae3765291361d9bf01e9009cfb4dcc.tar.gz
cuberite-1e9af56a67ae3765291361d9bf01e9009cfb4dcc.tar.bz2
cuberite-1e9af56a67ae3765291361d9bf01e9009cfb4dcc.tar.lz
cuberite-1e9af56a67ae3765291361d9bf01e9009cfb4dcc.tar.xz
cuberite-1e9af56a67ae3765291361d9bf01e9009cfb4dcc.tar.zst
cuberite-1e9af56a67ae3765291361d9bf01e9009cfb4dcc.zip
Diffstat (limited to 'source/cMonsterConfig.cpp')
-rw-r--r--source/cMonsterConfig.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/cMonsterConfig.cpp b/source/cMonsterConfig.cpp
index 456da1fc3..1226c74e2 100644
--- a/source/cMonsterConfig.cpp
+++ b/source/cMonsterConfig.cpp
@@ -17,6 +17,7 @@ struct cMonsterConfig::sAttributesStruct
float m_AttackDamage;
float m_AttackRange;
float m_AttackRate;
+ int m_MaxHealth;
};
struct cMonsterConfig::sMonsterConfigState
@@ -68,6 +69,8 @@ void cMonsterConfig::Initialize() {
printf("Got SightDistance: %3.3f \n",Attributes.m_SightDistance);
Attributes.m_AttackRate = (float)MonstersIniFile.GetValueF(SplitList[i].c_str(),"AttackRate",0);
printf("Got AttackRate: %3.3f \n",Attributes.m_AttackRate);
+ Attributes.m_MaxHealth = MonstersIniFile.GetValueI(SplitList[i].c_str(),"MaxHealth",0);
+ printf("Got MaxHealth: %d \n",Attributes.m_MaxHealth);
m_pState->AttributesList.push_front(Attributes);
}
}
@@ -84,6 +87,7 @@ void cMonsterConfig::AssignAttributes(cMonster *m, const char* n)
m->SetAttackRange(itr->m_AttackRange);
m->SetSightDistance(itr->m_SightDistance);
m->SetAttackRate((int)itr->m_AttackRate);
+ m->SetMaxHealth((int)itr->m_AttackRate);
}
}
}