diff options
author | Christophe Piveteau <chripiveteau@gmail.com> | 2014-08-13 19:16:00 +0200 |
---|---|---|
committer | Christophe Piveteau <chripiveteau@gmail.com> | 2014-08-13 19:16:00 +0200 |
commit | 3698c5c8295e6a6a0f37b17f3c04bb118cc58bf6 (patch) | |
tree | 39852e5411b3e4806f0058235657428967c86b35 /src/Entities/Minecart.cpp | |
parent | Implement ability to push minecarts on curved rails (diff) | |
download | cuberite-3698c5c8295e6a6a0f37b17f3c04bb118cc58bf6.tar cuberite-3698c5c8295e6a6a0f37b17f3c04bb118cc58bf6.tar.gz cuberite-3698c5c8295e6a6a0f37b17f3c04bb118cc58bf6.tar.bz2 cuberite-3698c5c8295e6a6a0f37b17f3c04bb118cc58bf6.tar.lz cuberite-3698c5c8295e6a6a0f37b17f3c04bb118cc58bf6.tar.xz cuberite-3698c5c8295e6a6a0f37b17f3c04bb118cc58bf6.tar.zst cuberite-3698c5c8295e6a6a0f37b17f3c04bb118cc58bf6.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Entities/Minecart.cpp | 14 |
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 ) |