summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Entities/Entity.cpp28
-rw-r--r--src/Mobs/Monster.cpp12
2 files changed, 22 insertions, 18 deletions
diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp
index a274e6780..32f220897 100644
--- a/src/Entities/Entity.cpp
+++ b/src/Entities/Entity.cpp
@@ -244,9 +244,9 @@ void cEntity::TakeDamage(eDamageType a_DamageType, cEntity * a_Attacker, int a_R
Vector3d Heading(0, 0, 0);
if (a_Attacker != NULL)
{
- Heading = a_Attacker->GetLookVector() * (a_Attacker->IsSprinting() ? 10 : 8);
+ Heading = a_Attacker->GetLookVector() * (a_Attacker->IsSprinting() ? 16 : 11);
+ Heading.y = 1.6;
}
- Heading.y = 2;
TDI.Knockback = Heading * a_KnockbackAmount;
DoTakeDamage(TDI);
@@ -731,21 +731,19 @@ void cEntity::HandlePhysics(float a_Dt, cChunk & a_Chunk)
}
NextSpeed.y += fallspeed;
}
- else
+
+ // Friction
+ if (NextSpeed.SqrLength() > 0.0004f)
{
- // Friction
- if (NextSpeed.SqrLength() > 0.0004f)
+ NextSpeed.x *= 0.7f / (1 + a_Dt);
+ if (fabs(NextSpeed.x) < 0.05)
{
- NextSpeed.x *= 0.7f / (1 + a_Dt);
- if (fabs(NextSpeed.x) < 0.05)
- {
- NextSpeed.x = 0;
- }
- NextSpeed.z *= 0.7f / (1 + a_Dt);
- if (fabs(NextSpeed.z) < 0.05)
- {
- NextSpeed.z = 0;
- }
+ NextSpeed.x = 0;
+ }
+ NextSpeed.z *= 0.7f / (1 + a_Dt);
+ if (fabs(NextSpeed.z) < 0.05)
+ {
+ NextSpeed.z = 0;
}
}
diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp
index 94df991a3..66c9aadeb 100644
--- a/src/Mobs/Monster.cpp
+++ b/src/Mobs/Monster.cpp
@@ -292,6 +292,10 @@ void cMonster::Tick(float a_Dt, cChunk & a_Chunk)
{
Distance *= 2.5;
}
+ else if (IsSwimming())
+ {
+ Distance *= 1.3;
+ }
else
{
// Don't let the mob move too much if he's falling.
@@ -301,11 +305,13 @@ void cMonster::Tick(float a_Dt, cChunk & a_Chunk)
AddSpeedX(Distance.x);
AddSpeedZ(Distance.z);
- if (m_EMState == ESCAPING)
- { // Runs Faster when escaping :D otherwise they just walk away
+ /* It's too buggy! */
+ /** if (m_EMState == ESCAPING)
+ {
+ // Runs Faster when escaping :D otherwise they just walk away
SetSpeedX (GetSpeedX() * 2.f);
SetSpeedZ (GetSpeedZ() * 2.f);
- }
+ } */
}
else
{