summaryrefslogtreecommitdiffstats
path: root/src/Entities
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-08-30 22:17:49 +0200
committermadmaxoft <github@xoft.cz>2014-08-30 22:17:49 +0200
commit26b8471280b876f624abb07db6616e67c11f5faa (patch)
treee058274eb79850074b2502a0a39a72c9b37e08fc /src/Entities
parentUpdated Core (diff)
parentWSSAnvil: Removed leftover debugging code. (diff)
downloadcuberite-26b8471280b876f624abb07db6616e67c11f5faa.tar
cuberite-26b8471280b876f624abb07db6616e67c11f5faa.tar.gz
cuberite-26b8471280b876f624abb07db6616e67c11f5faa.tar.bz2
cuberite-26b8471280b876f624abb07db6616e67c11f5faa.tar.lz
cuberite-26b8471280b876f624abb07db6616e67c11f5faa.tar.xz
cuberite-26b8471280b876f624abb07db6616e67c11f5faa.tar.zst
cuberite-26b8471280b876f624abb07db6616e67c11f5faa.zip
Diffstat (limited to 'src/Entities')
-rw-r--r--src/Entities/Minecart.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/Entities/Minecart.cpp b/src/Entities/Minecart.cpp
index 21c58fdba..1501eea84 100644
--- a/src/Entities/Minecart.cpp
+++ b/src/Entities/Minecart.cpp
@@ -891,31 +891,31 @@ bool cMinecart::TestEntityCollision(NIBBLETYPE a_RailMeta)
)
{
// Moving -X +Z
- if ((-GetSpeedX() * 0.4 / sqrt(2)) < 0.01)
+ if ((-GetSpeedX() * 0.4 / sqrt(2.0)) < 0.01)
{
// ~ SpeedX >= 0 Immobile or not moving in the "right" direction. Give it a bump!
- AddSpeedX(-4 / sqrt(2));
- AddSpeedZ(4 / sqrt(2));
+ AddSpeedX(-4 / sqrt(2.0));
+ AddSpeedZ(4 / sqrt(2.0));
}
else
{
// ~ SpeedX < 0 Moving in the "right" direction. Only accelerate it a bit.
- SetSpeedX(GetSpeedX() * 0.4 / sqrt(2));
- SetSpeedZ(GetSpeedZ() * 0.4 / sqrt(2));
+ SetSpeedX(GetSpeedX() * 0.4 / sqrt(2.0));
+ SetSpeedZ(GetSpeedZ() * 0.4 / sqrt(2.0));
}
}
- else if ((GetSpeedX() * 0.4 / sqrt(2)) < 0.01)
+ else if ((GetSpeedX() * 0.4 / sqrt(2.0)) < 0.01)
{
// Moving +X -Z
// ~ SpeedX <= 0 Immobile or not moving in the "right" direction
- AddSpeedX(4 / sqrt(2));
- AddSpeedZ(-4 / sqrt(2));
+ AddSpeedX(4 / sqrt(2.0));
+ AddSpeedZ(-4 / sqrt(2.0));
}
else
{
// ~ SpeedX > 0 Moving in the "right" direction
- SetSpeedX(GetSpeedX() * 0.4 / sqrt(2));
- SetSpeedZ(GetSpeedZ() * 0.4 / sqrt(2));
+ SetSpeedX(GetSpeedX() * 0.4 / sqrt(2.0));
+ SetSpeedZ(GetSpeedZ() * 0.4 / sqrt(2.0));
}
break;
}
@@ -943,28 +943,28 @@ bool cMinecart::TestEntityCollision(NIBBLETYPE a_RailMeta)
if ((GetSpeedX() * 0.4) < 0.01)
{
// ~ SpeedX <= 0 Immobile or not moving in the "right" direction
- AddSpeedX(4 / sqrt(2));
- AddSpeedZ(4 / sqrt(2));
+ AddSpeedX(4 / sqrt(2.0));
+ AddSpeedZ(4 / sqrt(2.0));
}
else
{
// ~ SpeedX > 0 Moving in the "right" direction
- SetSpeedX(GetSpeedX() * 0.4 / sqrt(2));
- SetSpeedZ(GetSpeedZ() * 0.4 / sqrt(2));
+ SetSpeedX(GetSpeedX() * 0.4 / sqrt(2.0));
+ SetSpeedZ(GetSpeedZ() * 0.4 / sqrt(2.0));
}
}
else if ((-GetSpeedX() * 0.4) < 0.01)
{
// Moving -X -Z
// ~ SpeedX >= 0 Immobile or not moving in the "right" direction
- AddSpeedX(-4 / sqrt(2));
- AddSpeedZ(-4 / sqrt(2));
+ AddSpeedX(-4 / sqrt(2.0));
+ AddSpeedZ(-4 / sqrt(2.0));
}
else
{
// ~ SpeedX < 0 Moving in the "right" direction
- SetSpeedX(GetSpeedX() * 0.4 / sqrt(2));
- SetSpeedZ(GetSpeedZ() * 0.4 / sqrt(2));
+ SetSpeedX(GetSpeedX() * 0.4 / sqrt(2.0));
+ SetSpeedZ(GetSpeedZ() * 0.4 / sqrt(2.0));
}
break;
}