diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Blocks/BlockHandler.cpp | 2 | ||||
-rw-r--r-- | src/DeadlockDetect.cpp | 7 | ||||
-rw-r--r-- | src/Entities/ExpOrb.cpp | 12 | ||||
-rw-r--r-- | src/Generating/Caves.h | 4 | ||||
-rw-r--r-- | src/Generating/DistortedHeightmap.cpp | 6 | ||||
-rw-r--r-- | src/Simulator/RedstoneSimulator.cpp | 2 |
6 files changed, 18 insertions, 15 deletions
diff --git a/src/Blocks/BlockHandler.cpp b/src/Blocks/BlockHandler.cpp index fde6bd803..d377823f7 100644 --- a/src/Blocks/BlockHandler.cpp +++ b/src/Blocks/BlockHandler.cpp @@ -375,7 +375,7 @@ void cBlockHandler::DropBlock(cWorld * a_World, cEntity * a_Digger, int a_BlockX MicroY = a_BlockY + 0.5; MicroZ = a_BlockZ + 0.5; - // Add random offset second (this causes pickups to spawn inside blocks most times, it's a little buggy) + // Add random offset second MicroX += r1.rand(1) - 0.5; MicroZ += r1.rand(1) - 0.5; diff --git a/src/DeadlockDetect.cpp b/src/DeadlockDetect.cpp index e699e0c84..c42d09b89 100644 --- a/src/DeadlockDetect.cpp +++ b/src/DeadlockDetect.cpp @@ -7,6 +7,7 @@ #include "DeadlockDetect.h" #include "Root.h" #include "World.h" +# include <cstdlib> @@ -137,11 +138,7 @@ void cDeadlockDetect::CheckWorldAge(const AString & a_WorldName, Int64 a_Age) void cDeadlockDetect::DeadlockDetected(void) { ASSERT(!"Deadlock detected"); - - // TODO: Make a crashdump / coredump - - // Crash the server intentionally: - *((volatile int *)0) = 0; + abort(); } diff --git a/src/Entities/ExpOrb.cpp b/src/Entities/ExpOrb.cpp index 1e5ee00ce..83c522a18 100644 --- a/src/Entities/ExpOrb.cpp +++ b/src/Entities/ExpOrb.cpp @@ -40,21 +40,25 @@ void cExpOrb::SpawnOn(cClientHandle & a_Client) void cExpOrb::Tick(float a_Dt, cChunk & a_Chunk) { - cPlayer * a_ClosestPlayer(m_World->FindClosestPlayer(Vector3f(GetPosition()), 4)); + cPlayer * a_ClosestPlayer(m_World->FindClosestPlayer(Vector3f(GetPosition()), 5)); if (a_ClosestPlayer) { Vector3f a_PlayerPos(a_ClosestPlayer->GetPosition()); + a_PlayerPos.y++; Vector3f a_Distance(a_PlayerPos - GetPosition()); - if (a_Distance.Length() < 0.1f) + double Distance(a_Distance.Length()); + if (Distance < 0.1f) { a_ClosestPlayer->DeltaExperience(m_Reward); a_ClosestPlayer->SendExperience(); Destroy(true); } - a_Distance.y = 0; a_Distance.Normalize(); - a_Distance *= 3; + a_Distance *= ((float) (5.5 - Distance)); SetSpeedX( a_Distance.x ); + SetSpeedY( a_Distance.y ); SetSpeedZ( a_Distance.z ); + BroadcastMovementUpdate(); } + HandlePhysics(a_Dt, a_Chunk); }
\ No newline at end of file diff --git a/src/Generating/Caves.h b/src/Generating/Caves.h index 70cf6fe8c..ea7f10bf4 100644 --- a/src/Generating/Caves.h +++ b/src/Generating/Caves.h @@ -70,8 +70,8 @@ public: cStructGenWormNestCaves(int a_Seed, int a_Size = 64, int a_Grid = 96, int a_MaxOffset = 128) : m_Noise(a_Seed), m_Size(a_Size), - m_Grid(a_Grid), - m_MaxOffset(a_MaxOffset) + m_MaxOffset(a_MaxOffset), + m_Grid(a_Grid) { } diff --git a/src/Generating/DistortedHeightmap.cpp b/src/Generating/DistortedHeightmap.cpp index a61d79bec..c32a3bf43 100644 --- a/src/Generating/DistortedHeightmap.cpp +++ b/src/Generating/DistortedHeightmap.cpp @@ -737,9 +737,11 @@ void cDistortedHeightmap::ComposeColumn(cChunkDesc & a_ChunkDesc, int a_RelX, in FillColumnMesa(a_ChunkDesc, a_RelX, a_RelZ); return; } - + default: + ASSERT(!"Unhandled biome"); + return; } // switch (Biome) - ASSERT(!"Unhandled biome"); + ASSERT(!"Unexpected fallthrough"); } diff --git a/src/Simulator/RedstoneSimulator.cpp b/src/Simulator/RedstoneSimulator.cpp index 9328b9fcb..daf3aaead 100644 --- a/src/Simulator/RedstoneSimulator.cpp +++ b/src/Simulator/RedstoneSimulator.cpp @@ -630,7 +630,7 @@ void cRedstoneSimulator::HandleRedstoneRepeater(int a_BlockX, int a_BlockY, int // Self not in list, add self to list sRepeatersDelayList RC; RC.a_BlockPos = Vector3i(a_BlockX, a_BlockY, a_BlockZ); - RC.a_DelayTicks = ((a_Meta & 0xC) >> 0x2) + 1; + RC.a_DelayTicks = ((a_Meta & 0xC) >> 0x2); // Repeaters power off slower than they power on, so no +1. Why? No idea. RC.a_ElapsedTicks = 0; m_RepeatersDelayList.push_back(RC); return; |