summaryrefslogtreecommitdiffstats
path: root/src/Entities
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-08-04 12:50:57 +0200
committerMattes D <github@xoft.cz>2014-08-04 12:50:57 +0200
commitb18794d835906add37995cec4207ee4b4b0d1997 (patch)
tree93cb320e9911343f052b722278231c8b9dd79a1a /src/Entities
parentMerge pull request #1285 from mc-server/StrCaseRefactor (diff)
parentMerge branch 'master' into Monster (diff)
downloadcuberite-b18794d835906add37995cec4207ee4b4b0d1997.tar
cuberite-b18794d835906add37995cec4207ee4b4b0d1997.tar.gz
cuberite-b18794d835906add37995cec4207ee4b4b0d1997.tar.bz2
cuberite-b18794d835906add37995cec4207ee4b4b0d1997.tar.lz
cuberite-b18794d835906add37995cec4207ee4b4b0d1997.tar.xz
cuberite-b18794d835906add37995cec4207ee4b4b0d1997.tar.zst
cuberite-b18794d835906add37995cec4207ee4b4b0d1997.zip
Diffstat (limited to '')
-rw-r--r--src/Entities/Entity.cpp28
1 files changed, 13 insertions, 15 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;
}
}