Monsters will now attack. Additional checks have been added when generating spawn.

Monsters will now attack. Additional checks have been added when generating spawn.
This commit is contained in:
tumultenrx
2015-03-13 00:02:36 +01:00
parent f9991c9f92
commit a215070cf2
6 changed files with 72 additions and 11 deletions
+1 -2
View File
@@ -69,8 +69,7 @@ void cSkeleton::MoveToPosition(const Vector3d & a_Position)
void cSkeleton::Attack(std::chrono::milliseconds a_Dt)
{
m_AttackInterval += a_Dt.count() * m_AttackRate;
m_AttackInterval += (static_cast<float>(a_Dt.count()) / 1000) * m_AttackRate;
if ((m_Target != nullptr) && (m_AttackInterval > 3.0))
{
// Setting this higher gives us more wiggle room for attackrate