summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authormathiascode <mail@mathias.is>2020-03-30 19:09:06 +0200
committerMattes D <github@xoft.cz>2020-04-02 09:30:50 +0200
commitd5c58c6b17c90f3e139751890339d0b390596b8a (patch)
treeef752004a3d1defdc7e7d558492d200ad2517017 /src
parentFix explosion knockback issues and tweak knockback strength (#4590) (diff)
downloadcuberite-d5c58c6b17c90f3e139751890339d0b390596b8a.tar
cuberite-d5c58c6b17c90f3e139751890339d0b390596b8a.tar.gz
cuberite-d5c58c6b17c90f3e139751890339d0b390596b8a.tar.bz2
cuberite-d5c58c6b17c90f3e139751890339d0b390596b8a.tar.lz
cuberite-d5c58c6b17c90f3e139751890339d0b390596b8a.tar.xz
cuberite-d5c58c6b17c90f3e139751890339d0b390596b8a.tar.zst
cuberite-d5c58c6b17c90f3e139751890339d0b390596b8a.zip
Diffstat (limited to '')
-rw-r--r--src/Mobs/Monster.h10
-rw-r--r--src/MonsterConfig.cpp4
2 files changed, 7 insertions, 7 deletions
diff --git a/src/Mobs/Monster.h b/src/Mobs/Monster.h
index 567e13ab2..93c29c533 100644
--- a/src/Mobs/Monster.h
+++ b/src/Mobs/Monster.h
@@ -116,9 +116,9 @@ public:
virtual void InStateChasing (std::chrono::milliseconds a_Dt, cChunk & a_Chunk);
virtual void InStateEscaping(std::chrono::milliseconds a_Dt, cChunk & a_Chunk);
- int GetAttackRate() { return static_cast<int>(m_AttackRate); }
- void SetAttackRate(float a_AttackRate) { m_AttackRate = a_AttackRate; }
- void SetAttackRange(int a_AttackRange) { m_AttackRange = a_AttackRange; }
+ double GetAttackRate() { return m_AttackRate; }
+ void SetAttackRate(double a_AttackRate) { m_AttackRate = a_AttackRate; }
+ void SetAttackRange(double a_AttackRange) { m_AttackRange = a_AttackRange; }
void SetAttackDamage(int a_AttackDamage) { m_AttackDamage = a_AttackDamage; }
void SetSightDistance(int a_SightDistance) { m_SightDistance = a_SightDistance; }
@@ -269,9 +269,9 @@ protected:
AString m_SoundDeath;
AString m_SoundAmbient;
- float m_AttackRate;
+ double m_AttackRate;
int m_AttackDamage;
- int m_AttackRange;
+ double m_AttackRange;
int m_AttackCoolDownTicksLeft;
int m_SightDistance;
diff --git a/src/MonsterConfig.cpp b/src/MonsterConfig.cpp
index 1cb91dfec..271a72a7f 100644
--- a/src/MonsterConfig.cpp
+++ b/src/MonsterConfig.cpp
@@ -14,7 +14,7 @@ struct cMonsterConfig::sAttributesStruct
AString m_Name;
int m_SightDistance;
int m_AttackDamage;
- int m_AttackRange;
+ double m_AttackRange;
double m_AttackRate;
double m_MaxHealth;
bool m_IsFireproof;
@@ -71,7 +71,7 @@ void cMonsterConfig::Initialize()
AString Name = MonstersIniFile.GetKeyName(i);
Attributes.m_Name = Name;
Attributes.m_AttackDamage = MonstersIniFile.GetValueI(Name, "AttackDamage", 0);
- Attributes.m_AttackRange = MonstersIniFile.GetValueI(Name, "AttackRange", 0);
+ Attributes.m_AttackRange = MonstersIniFile.GetValueF(Name, "AttackRange", 0);
Attributes.m_SightDistance = MonstersIniFile.GetValueI(Name, "SightDistance", 0);
Attributes.m_AttackRate = MonstersIniFile.GetValueF(Name, "AttackRate", 0);
Attributes.m_MaxHealth = MonstersIniFile.GetValueF(Name, "MaxHealth", 1);