1
0

Attempt to fix knockback and swimming.

This commit is contained in:
Howaner 2014-08-04 01:34:12 +02:00
parent b19874e6f2
commit 0911072d27
2 changed files with 22 additions and 18 deletions

View File

@ -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,8 +731,7 @@ void cEntity::HandlePhysics(float a_Dt, cChunk & a_Chunk)
}
NextSpeed.y += fallspeed;
}
else
{
// Friction
if (NextSpeed.SqrLength() > 0.0004f)
{
@ -747,7 +746,6 @@ void cEntity::HandlePhysics(float a_Dt, cChunk & a_Chunk)
NextSpeed.z = 0;
}
}
}
// Adjust X and Z speed for COBWEB temporary. This speed modification should be handled inside block handlers since we
// might have different speed modifiers according to terrain.

View File

@ -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
{