diff options
author | Tycho <work.tycho+git@gmail.com> | 2015-01-16 14:42:44 +0100 |
---|---|---|
committer | Tycho <work.tycho+git@gmail.com> | 2015-01-16 14:42:44 +0100 |
commit | 8dc9cf0c769b46dd3a97440f76cae4d83b52348e (patch) | |
tree | 85b5cf2003bc21aef4c451257731d9799a97c702 /src/Entities | |
parent | Converted cExpOrbEntity to std::chrono (diff) | |
download | cuberite-8dc9cf0c769b46dd3a97440f76cae4d83b52348e.tar cuberite-8dc9cf0c769b46dd3a97440f76cae4d83b52348e.tar.gz cuberite-8dc9cf0c769b46dd3a97440f76cae4d83b52348e.tar.bz2 cuberite-8dc9cf0c769b46dd3a97440f76cae4d83b52348e.tar.lz cuberite-8dc9cf0c769b46dd3a97440f76cae4d83b52348e.tar.xz cuberite-8dc9cf0c769b46dd3a97440f76cae4d83b52348e.tar.zst cuberite-8dc9cf0c769b46dd3a97440f76cae4d83b52348e.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Entities/Minecart.cpp | 10 | ||||
-rw-r--r-- | src/Entities/Minecart.h | 6 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/Entities/Minecart.cpp b/src/Entities/Minecart.cpp index 552d70de7..a906c9767 100644 --- a/src/Entities/Minecart.cpp +++ b/src/Entities/Minecart.cpp @@ -165,12 +165,12 @@ void cMinecart::HandlePhysics(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) switch (InsideType) { - case E_BLOCK_RAIL: HandleRailPhysics(InsideMeta, a_Dt.count()); break; + case E_BLOCK_RAIL: HandleRailPhysics(InsideMeta, a_Dt); break; case E_BLOCK_ACTIVATOR_RAIL: break; case E_BLOCK_POWERED_RAIL: HandlePoweredRailPhysics(InsideMeta); break; case E_BLOCK_DETECTOR_RAIL: { - HandleDetectorRailPhysics(InsideMeta, a_Dt.count()); + HandleDetectorRailPhysics(InsideMeta, a_Dt); WasDetectorRail = true; break; } @@ -205,7 +205,7 @@ void cMinecart::HandlePhysics(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) -void cMinecart::HandleRailPhysics(NIBBLETYPE a_RailMeta, float a_Dt) +void cMinecart::HandleRailPhysics(NIBBLETYPE a_RailMeta, std::chrono::milliseconds a_Dt) { /* NOTE: Please bear in mind that taking away from negatives make them even more negative, @@ -565,7 +565,7 @@ void cMinecart::HandlePoweredRailPhysics(NIBBLETYPE a_RailMeta) -void cMinecart::HandleDetectorRailPhysics(NIBBLETYPE a_RailMeta, float a_Dt) +void cMinecart::HandleDetectorRailPhysics(NIBBLETYPE a_RailMeta, std::chrono::milliseconds a_Dt) { m_World->SetBlockMeta(m_DetectorRailPosition, a_RailMeta | 0x08); @@ -576,7 +576,7 @@ void cMinecart::HandleDetectorRailPhysics(NIBBLETYPE a_RailMeta, float a_Dt) -void cMinecart::HandleActivatorRailPhysics(NIBBLETYPE a_RailMeta, float a_Dt) +void cMinecart::HandleActivatorRailPhysics(NIBBLETYPE a_RailMeta, std::chrono::milliseconds a_Dt) { HandleRailPhysics(a_RailMeta & 0x07, a_Dt); } diff --git a/src/Entities/Minecart.h b/src/Entities/Minecart.h index 1c6f4a6c4..898776e71 100644 --- a/src/Entities/Minecart.h +++ b/src/Entities/Minecart.h @@ -56,7 +56,7 @@ protected: /** Handles physics on normal rails For each tick, slow down on flat rails, speed up or slow down on ascending/descending rails (depending on direction), and turn on curved rails */ - void HandleRailPhysics(NIBBLETYPE a_RailMeta, float a_Dt); + void HandleRailPhysics(NIBBLETYPE a_RailMeta, std::chrono::milliseconds a_Dt); /** Handles powered rail physics Each tick, speed up or slow down cart, depending on metadata of rail (powered or not) @@ -66,10 +66,10 @@ protected: /** Handles detector rail activation Activates detector rails when a minecart is on them. Calls HandleRailPhysics() for physics simulations */ - void HandleDetectorRailPhysics(NIBBLETYPE a_RailMeta, float a_Dt); + void HandleDetectorRailPhysics(NIBBLETYPE a_RailMeta, std::chrono::milliseconds a_Dt); /** Handles activator rails - placeholder for future implementation */ - void HandleActivatorRailPhysics(NIBBLETYPE a_RailMeta, float a_Dt); + void HandleActivatorRailPhysics(NIBBLETYPE a_RailMeta, std::chrono::milliseconds a_Dt); /** Snaps a mincecart to a rail's axis, resetting its speed For curved rails, it changes the cart's direction as well as snapping it to axis */ |