summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Entities/Minecart.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/Entities/Minecart.cpp b/src/Entities/Minecart.cpp
index 19eaa207f..5cf56d3d2 100644
--- a/src/Entities/Minecart.cpp
+++ b/src/Entities/Minecart.cpp
@@ -879,8 +879,12 @@ bool cMinecart::TestEntityCollision(NIBBLETYPE a_RailMeta)
MinecartCollisionCallback.GetCollidedEntityPosition().z - GetPosZ()
);
- if ( Distance.z == 0. ) Distance.z = 0.0001;
- if ( ((Distance.z>=0)&&((Distance.x/Distance.z)>=1)) || ((Distance.z<0)&&((Distance.x/Distance.z)<=1)) )
+ if ( Distance.z == 0. )
+ {
+ Distance.z = 0.0001;
+ }
+
+ if ( ((Distance.z>=0)&&((Distance.x/Distance.z)>=1)) || ((Distance.z<0)&&((Distance.x/Distance.z)<=1)) )
{
if ( (-GetSpeedX() * 0.4) < 0.01 )
{
@@ -917,7 +921,11 @@ bool cMinecart::TestEntityCollision(NIBBLETYPE a_RailMeta)
MinecartCollisionCallback.GetCollidedEntityPosition().z - GetPosZ()
);
- if ( Distance.z == 0. ) Distance.z = 0.0001;
+ if ( Distance.z == 0. )
+ {
+ Distance.z = 0.0001;
+ }
+
if ( ((Distance.z>=0)&&((Distance.x/Distance.z)<=-1)) || ((Distance.z<0)&&((Distance.x/Distance.z)>=-1)) )
{
if ( (GetSpeedX() * 0.4) < 0.01 )