summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-07-17 23:15:53 +0200
committermadmaxoft <github@xoft.cz>2014-07-17 23:16:55 +0200
commitc03161f75d22a7965aea20fb9843ae580a07079a (patch)
treeabb301835bb65031bee9e040bde43dd078164692 /src
parentMore trailing whitespace fixes. (diff)
downloadcuberite-c03161f75d22a7965aea20fb9843ae580a07079a.tar
cuberite-c03161f75d22a7965aea20fb9843ae580a07079a.tar.gz
cuberite-c03161f75d22a7965aea20fb9843ae580a07079a.tar.bz2
cuberite-c03161f75d22a7965aea20fb9843ae580a07079a.tar.lz
cuberite-c03161f75d22a7965aea20fb9843ae580a07079a.tar.xz
cuberite-c03161f75d22a7965aea20fb9843ae580a07079a.tar.zst
cuberite-c03161f75d22a7965aea20fb9843ae580a07079a.zip
Diffstat (limited to '')
-rw-r--r--src/Blocks/BlockSnow.h4
-rw-r--r--src/Entities/Entity.cpp2
-rw-r--r--src/Entities/Entity.h2
-rw-r--r--src/Entities/ExpOrb.cpp4
-rw-r--r--src/Entities/HangingEntity.cpp2
-rw-r--r--src/Entities/ItemFrame.cpp2
-rw-r--r--src/Entities/Pickup.cpp2
-rw-r--r--src/Entities/Pickup.h2
-rw-r--r--src/Entities/Player.cpp8
-rw-r--r--src/Entities/Player.h26
-rw-r--r--src/Generating/Caves.cpp12
-rw-r--r--src/Generating/ChunkGenerator.cpp6
-rw-r--r--src/Generating/FinishGen.h2
-rw-r--r--src/Generating/Ravines.cpp22
-rw-r--r--src/Generating/VillageGen.cpp2
-rw-r--r--src/Items/ItemFishingRod.h2
-rw-r--r--src/Items/ItemHandler.cpp14
-rw-r--r--src/Mobs/Monster.cpp2
-rw-r--r--src/OSSupport/Semaphore.cpp50
-rw-r--r--src/OSSupport/Sleep.cpp2
-rw-r--r--src/OSSupport/Thread.cpp2
-rw-r--r--src/Protocol/Protocol125.cpp18
-rw-r--r--src/Protocol/Protocol17x.cpp7
-rw-r--r--src/Simulator/DelayedFluidSimulator.h2
-rw-r--r--src/Simulator/FluidSimulator.cpp2
-rw-r--r--src/Simulator/IncrementalRedstoneSimulator.cpp2
-rw-r--r--src/Simulator/IncrementalRedstoneSimulator.h2
-rw-r--r--src/UI/SlotArea.h4
-rw-r--r--src/WorldStorage/MapSerializer.h7
29 files changed, 115 insertions, 99 deletions
diff --git a/src/Blocks/BlockSnow.h b/src/Blocks/BlockSnow.h
index 27fc17e7f..977f19a16 100644
--- a/src/Blocks/BlockSnow.h
+++ b/src/Blocks/BlockSnow.h
@@ -33,8 +33,8 @@ public:
if ((BlockBeforePlacement == E_BLOCK_SNOW) && (MetaBeforePlacement < 7))
{
// Only increment if:
- // A snow block was already there (not first time placement) AND
- // Height is smaller than 7, the maximum possible height
+ // - A snow block was already there (not first time placement) AND
+ // - Height is smaller than 7, the maximum possible height
MetaBeforePlacement++;
}
diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp
index 7d130aa47..28817428f 100644
--- a/src/Entities/Entity.cpp
+++ b/src/Entities/Entity.cpp
@@ -345,7 +345,7 @@ bool cEntity::DoTakeDamage(TakeDamageInfo & a_TDI)
switch (KnockbackLevel)
{
case 1: AdditionalSpeed.Set(5, 0.3, 5); break;
- case 2: AdditionalSpeed.Set(8, 0.3, 8); break;
+ case 2: AdditionalSpeed.Set(8, 0.3, 8); break;
default: break;
}
AddSpeed(a_TDI.Knockback + AdditionalSpeed);
diff --git a/src/Entities/Entity.h b/src/Entities/Entity.h
index 7abe5db37..88f8528e9 100644
--- a/src/Entities/Entity.h
+++ b/src/Entities/Entity.h
@@ -485,7 +485,7 @@ protected:
/// Whether the entity is capable of taking fire or lava damage.
bool m_IsFireproof;
-
+
/// Time, in ticks, since the last damage dealt by being on fire. Valid only if on fire (IsOnFire())
int m_TicksSinceLastBurnDamage;
diff --git a/src/Entities/ExpOrb.cpp b/src/Entities/ExpOrb.cpp
index e437c24ef..ed225b8e6 100644
--- a/src/Entities/ExpOrb.cpp
+++ b/src/Entities/ExpOrb.cpp
@@ -6,7 +6,7 @@
cExpOrb::cExpOrb(double a_X, double a_Y, double a_Z, int a_Reward)
- : cEntity(etExpOrb, a_X, a_Y, a_Z, 0.98, 0.98)
+ : cEntity(etExpOrb, a_X, a_Y, a_Z, 0.98, 0.98)
, m_Reward(a_Reward)
, m_Timer(0.f)
{
@@ -19,7 +19,7 @@ cExpOrb::cExpOrb(double a_X, double a_Y, double a_Z, int a_Reward)
cExpOrb::cExpOrb(const Vector3d & a_Pos, int a_Reward)
- : cEntity(etExpOrb, a_Pos.x, a_Pos.y, a_Pos.z, 0.98, 0.98)
+ : cEntity(etExpOrb, a_Pos.x, a_Pos.y, a_Pos.z, 0.98, 0.98)
, m_Reward(a_Reward)
, m_Timer(0.f)
{
diff --git a/src/Entities/HangingEntity.cpp b/src/Entities/HangingEntity.cpp
index d7a7ba943..32d2b226d 100644
--- a/src/Entities/HangingEntity.cpp
+++ b/src/Entities/HangingEntity.cpp
@@ -10,7 +10,7 @@
cHangingEntity::cHangingEntity(eEntityType a_EntityType, eBlockFace a_BlockFace, double a_X, double a_Y, double a_Z)
- : cEntity(a_EntityType, a_X, a_Y, a_Z, 0.8, 0.8)
+ : cEntity(a_EntityType, a_X, a_Y, a_Z, 0.8, 0.8)
, m_BlockFace(a_BlockFace)
{
SetMaxHealth(1);
diff --git a/src/Entities/ItemFrame.cpp b/src/Entities/ItemFrame.cpp
index 144c6d5aa..f0b0c8c65 100644
--- a/src/Entities/ItemFrame.cpp
+++ b/src/Entities/ItemFrame.cpp
@@ -10,7 +10,7 @@
cItemFrame::cItemFrame(eBlockFace a_BlockFace, double a_X, double a_Y, double a_Z)
- : cHangingEntity(etItemFrame, a_BlockFace, a_X, a_Y, a_Z)
+ : cHangingEntity(etItemFrame, a_BlockFace, a_X, a_Y, a_Z)
, m_Item(E_BLOCK_AIR)
, m_Rotation(0)
{
diff --git a/src/Entities/Pickup.cpp b/src/Entities/Pickup.cpp
index 18df1a210..aab534f41 100644
--- a/src/Entities/Pickup.cpp
+++ b/src/Entities/Pickup.cpp
@@ -85,7 +85,7 @@ protected:
cPickup::cPickup(double a_PosX, double a_PosY, double a_PosZ, const cItem & a_Item, bool IsPlayerCreated, float a_SpeedX /* = 0.f */, float a_SpeedY /* = 0.f */, float a_SpeedZ /* = 0.f */)
- : cEntity(etPickup, a_PosX, a_PosY, a_PosZ, 0.2, 0.2)
+ : cEntity(etPickup, a_PosX, a_PosY, a_PosZ, 0.2, 0.2)
, m_Timer(0.f)
, m_Item(a_Item)
, m_bCollected(false)
diff --git a/src/Entities/Pickup.h b/src/Entities/Pickup.h
index d50941280..d7c5d2b26 100644
--- a/src/Entities/Pickup.h
+++ b/src/Entities/Pickup.h
@@ -32,7 +32,7 @@ public:
virtual void SpawnOn(cClientHandle & a_ClientHandle) override;
- bool CollectedBy(cPlayer * a_Dest); // tolua_export
+ bool CollectedBy(cPlayer * a_Dest); // tolua_export
virtual void Tick(float a_Dt, cChunk & a_Chunk) override;
diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp
index 6e7623f4a..a356ebba7 100644
--- a/src/Entities/Player.cpp
+++ b/src/Entities/Player.cpp
@@ -1347,7 +1347,7 @@ void cPlayer::SetVisible(bool a_bVisible)
if (!a_bVisible && m_bVisible)
{
m_bVisible = false;
- m_World->BroadcastDestroyEntity(*this, m_ClientHandle); // Destroy on all clients
+ m_World->BroadcastDestroyEntity(*this, m_ClientHandle); // Destroy on all clients
}
}
@@ -1455,7 +1455,7 @@ bool cPlayer::IsInGroup( const AString & a_Group )
void cPlayer::ResolvePermissions()
{
- m_ResolvedPermissions.clear(); // Start with an empty map yo~
+ m_ResolvedPermissions.clear(); // Start with an empty map
// Copy all player specific permissions into the resolved permissions map
for( PermissionMap::iterator itr = m_Permissions.begin(); itr != m_Permissions.end(); ++itr )
@@ -1483,7 +1483,7 @@ void cPlayer::ResolveGroups()
m_ResolvedGroups.clear();
// Get a complete resolved list of all groups the player is in
- std::map< cGroup*, bool > AllGroups; // Use a map, because it's faster than iterating through a list to find duplicates
+ std::map< cGroup*, bool > AllGroups; // Use a map, because it's faster than iterating through a list to find duplicates
GroupList ToIterate;
for( GroupList::iterator GroupItr = m_Groups.begin(); GroupItr != m_Groups.end(); ++GroupItr )
{
@@ -1501,7 +1501,7 @@ void cPlayer::ResolveGroups()
else
{
AllGroups[ CurrentGroup ] = true;
- m_ResolvedGroups.push_back( CurrentGroup ); // Add group to resolved list
+ m_ResolvedGroups.push_back( CurrentGroup ); // Add group to resolved list
const cGroup::GroupList & Inherits = CurrentGroup->GetInherits();
for( cGroup::GroupList::const_iterator itr = Inherits.begin(); itr != Inherits.end(); ++itr )
{
diff --git a/src/Entities/Player.h b/src/Entities/Player.h
index 0eef3e6e1..7c287d41b 100644
--- a/src/Entities/Player.h
+++ b/src/Entities/Player.h
@@ -119,11 +119,11 @@ public:
void SetTouchGround( bool a_bTouchGround );
inline void SetStance( const double a_Stance ) { m_Stance = a_Stance; }
- double GetEyeHeight(void) const; // tolua_export
- Vector3d GetEyePosition(void) const; // tolua_export
+ double GetEyeHeight(void) const; // tolua_export
+ Vector3d GetEyePosition(void) const; // tolua_export
inline bool IsOnGround(void) const {return m_bTouchGround; } // tolua_export
inline double GetStance(void) const { return GetPosY() + 1.62; } // tolua_export // TODO: Proper stance when crouching etc.
- inline cInventory & GetInventory(void) { return m_Inventory; } // tolua_export
+ inline cInventory & GetInventory(void) { return m_Inventory; } // tolua_export
inline const cInventory & GetInventory(void) const { return m_Inventory; }
/** Gets the contents of the player's associated enderchest */
@@ -239,15 +239,15 @@ public:
typedef std::list< std::string > StringList;
/** Adds a player to existing group or creates a new group when it doesn't exist */
- void AddToGroup( const AString & a_GroupName ); // tolua_export
+ void AddToGroup( const AString & a_GroupName ); // tolua_export
/** Removes a player from the group, resolves permissions and group inheritance (case sensitive) */
- void RemoveFromGroup( const AString & a_GroupName ); // tolua_export
+ void RemoveFromGroup( const AString & a_GroupName ); // tolua_export
- bool HasPermission( const AString & a_Permission ); // tolua_export
- const GroupList & GetGroups() { return m_Groups; } // >> EXPORTED IN MANUALBINDINGS <<
- StringList GetResolvedPermissions(); // >> EXPORTED IN MANUALBINDINGS <<
- bool IsInGroup( const AString & a_Group ); // tolua_export
+ bool HasPermission( const AString & a_Permission ); // tolua_export
+ const GroupList & GetGroups() { return m_Groups; } // >> EXPORTED IN MANUALBINDINGS <<
+ StringList GetResolvedPermissions(); // >> EXPORTED IN MANUALBINDINGS <<
+ bool IsInGroup( const AString & a_Group ); // tolua_export
// tolua_begin
@@ -326,10 +326,10 @@ public:
virtual void Killed(cEntity * a_Victim) override;
- void Respawn(void); // tolua_export
+ void Respawn(void); // tolua_export
- void SetVisible( bool a_bVisible ); // tolua_export
- bool IsVisible(void) const { return m_bVisible; } // tolua_export
+ void SetVisible( bool a_bVisible ); // tolua_export
+ bool IsVisible(void) const { return m_bVisible; } // tolua_export
/** Moves the player to the specified world.
Returns true if successful, false on failure (world not found). */
@@ -345,7 +345,7 @@ public:
Returns true on success, false on failure. */
bool LoadFromFile(const AString & a_FileName);
- void LoadPermissionsFromDisk(void); // tolua_export
+ void LoadPermissionsFromDisk(void); // tolua_export
const AString & GetLoadedWorldName() { return m_LoadedWorldName; }
diff --git a/src/Generating/Caves.cpp b/src/Generating/Caves.cpp
index f543846d2..3571b29d4 100644
--- a/src/Generating/Caves.cpp
+++ b/src/Generating/Caves.cpp
@@ -555,14 +555,14 @@ AString cCaveTunnel::ExportAsSVG(int a_Color, int a_OffsetX, int a_OffsetZ) cons
{
AString SVG;
SVG.reserve(m_Points.size() * 20 + 200);
- AppendPrintf(SVG, "<path style=\"fill:none;stroke:#%06x;stroke-width:1px;\"\nd=\"", a_Color);
- char Prefix = 'M'; // The first point needs "M" prefix, all the others need "L"
- for (cCaveDefPoints::const_iterator itr = m_Points.begin(); itr != m_Points.end(); ++itr)
- {
+ AppendPrintf(SVG, "<path style=\"fill:none;stroke:#%06x;stroke-width:1px;\"\nd=\"", a_Color);
+ char Prefix = 'M'; // The first point needs "M" prefix, all the others need "L"
+ for (cCaveDefPoints::const_iterator itr = m_Points.begin(); itr != m_Points.end(); ++itr)
+ {
AppendPrintf(SVG, "%c %d,%d ", Prefix, a_OffsetX + itr->m_BlockX, a_OffsetZ + itr->m_BlockZ);
Prefix = 'L';
- }
- SVG.append("\"/>\n");
+ }
+ SVG.append("\"/>\n");
return SVG;
}
#endif // _DEBUG
diff --git a/src/Generating/ChunkGenerator.cpp b/src/Generating/ChunkGenerator.cpp
index 3f8f77f09..0947eeae5 100644
--- a/src/Generating/ChunkGenerator.cpp
+++ b/src/Generating/ChunkGenerator.cpp
@@ -228,10 +228,10 @@ void cChunkGenerator::Execute(void)
continue;
}
- cChunkCoords coords = m_Queue.front(); // Get next coord from queue
- m_Queue.erase( m_Queue.begin() ); // Remove coordinate from queue
+ cChunkCoords coords = m_Queue.front(); // Get next coord from queue
+ m_Queue.erase( m_Queue.begin() ); // Remove coordinate from queue
bool SkipEnabled = (m_Queue.size() > QUEUE_SKIP_LIMIT);
- Lock.Unlock(); // Unlock ASAP
+ Lock.Unlock(); // Unlock ASAP
m_evtRemoved.Set();
// Display perf info once in a while:
diff --git a/src/Generating/FinishGen.h b/src/Generating/FinishGen.h
index 2e5732929..fdeb86e73 100644
--- a/src/Generating/FinishGen.h
+++ b/src/Generating/FinishGen.h
@@ -199,7 +199,7 @@ protected:
// cFinishGen override:
virtual void GenFinish(cChunkDesc & a_ChunkDesc) override;
- /// Tries to place a spring at the specified coords, checks neighbors. Returns true if successful
+ /// Tries to place a spring at the specified coords, checks neighbors. Returns true if successful
bool TryPlaceSpring(cChunkDesc & a_ChunkDesc, int x, int y, int z);
} ;
diff --git a/src/Generating/Ravines.cpp b/src/Generating/Ravines.cpp
index 8f62669e7..86e27d8ed 100644
--- a/src/Generating/Ravines.cpp
+++ b/src/Generating/Ravines.cpp
@@ -283,25 +283,25 @@ void cStructGenRavines::cRavine::FinishLinear(void)
AString cStructGenRavines::cRavine::ExportAsSVG(int a_Color, int a_OffsetX, int a_OffsetZ) const
{
AString SVG;
- AppendPrintf(SVG, "<path style=\"fill:none;stroke:#%06x;stroke-width:1px;\"\nd=\"", a_Color);
- char Prefix = 'M'; // The first point needs "M" prefix, all the others need "L"
- for (cRavDefPoints::const_iterator itr = m_Points.begin(); itr != m_Points.end(); ++itr)
- {
+ AppendPrintf(SVG, "<path style=\"fill:none;stroke:#%06x;stroke-width:1px;\"\nd=\"", a_Color);
+ char Prefix = 'M'; // The first point needs "M" prefix, all the others need "L"
+ for (cRavDefPoints::const_iterator itr = m_Points.begin(); itr != m_Points.end(); ++itr)
+ {
AppendPrintf(SVG, "%c %d,%d ", Prefix, a_OffsetX + itr->m_BlockX, a_OffsetZ + itr->m_BlockZ);
Prefix = 'L';
- }
- SVG.append("\"/>\n");
-
- // Base point highlight:
- AppendPrintf(SVG, "<path style=\"fill:none;stroke:#ff0000;stroke-width:1px;\"\nd=\"M %d,%d L %d,%d\"/>\n",
+ }
+ SVG.append("\"/>\n");
+
+ // Base point highlight:
+ AppendPrintf(SVG, "<path style=\"fill:none;stroke:#ff0000;stroke-width:1px;\"\nd=\"M %d,%d L %d,%d\"/>\n",
a_OffsetX + m_OriginX - 5, a_OffsetZ + m_OriginZ, a_OffsetX + m_OriginX + 5, a_OffsetZ + m_OriginZ
);
- AppendPrintf(SVG, "<path style=\"fill:none;stroke:#ff0000;stroke-width:1px;\"\nd=\"M %d,%d L %d,%d\"/>\n",
+ AppendPrintf(SVG, "<path style=\"fill:none;stroke:#ff0000;stroke-width:1px;\"\nd=\"M %d,%d L %d,%d\"/>\n",
a_OffsetX + m_OriginX, a_OffsetZ + m_OriginZ - 5, a_OffsetX + m_OriginX, a_OffsetZ + m_OriginZ + 5
);
// A gray line from the base point to the first point of the ravine, for identification:
- AppendPrintf(SVG, "<path style=\"fill:none;stroke:#cfcfcf;stroke-width:1px;\"\nd=\"M %d,%d L %d,%d\"/>\n",
+ AppendPrintf(SVG, "<path style=\"fill:none;stroke:#cfcfcf;stroke-width:1px;\"\nd=\"M %d,%d L %d,%d\"/>\n",
a_OffsetX + m_OriginX, a_OffsetZ + m_OriginZ, a_OffsetX + m_Points.front().m_BlockX, a_OffsetZ + m_Points.front().m_BlockZ
);
diff --git a/src/Generating/VillageGen.cpp b/src/Generating/VillageGen.cpp
index fdec2425d..cade923c9 100644
--- a/src/Generating/VillageGen.cpp
+++ b/src/Generating/VillageGen.cpp
@@ -95,7 +95,7 @@ public:
return ((const cPrefab &)a_NewPiece).GetPieceWeight(a_PlacedPiece, a_ExistingConnector);
}
-} ;
+};
diff --git a/src/Items/ItemFishingRod.h b/src/Items/ItemFishingRod.h
index 0c07cd422..6350a38ba 100644
--- a/src/Items/ItemFishingRod.h
+++ b/src/Items/ItemFishingRod.h
@@ -63,7 +63,7 @@ class cSweepEntityCallback :
{
public:
cSweepEntityCallback(Vector3d a_PlayerPos) :
- m_PlayerPos(a_PlayerPos)
+ m_PlayerPos(a_PlayerPos)
{
}
diff --git a/src/Items/ItemHandler.cpp b/src/Items/ItemHandler.cpp
index 3e02a43fa..178bc2fca 100644
--- a/src/Items/ItemHandler.cpp
+++ b/src/Items/ItemHandler.cpp
@@ -459,13 +459,13 @@ bool cItemHandler::IsTool()
{
// TODO: Rewrite this to list all tools specifically
return
- (m_ItemType >= 256 && m_ItemType <= 259)
- || (m_ItemType == 261)
- || (m_ItemType >= 267 && m_ItemType <= 279)
- || (m_ItemType >= 283 && m_ItemType <= 286)
- || (m_ItemType >= 290 && m_ItemType <= 294)
- || (m_ItemType == 325)
- || (m_ItemType == 346);
+ ((m_ItemType >= 256) && (m_ItemType <= 259)) ||
+ (m_ItemType == 261) ||
+ ((m_ItemType >= 267) && (m_ItemType <= 279)) ||
+ ((m_ItemType >= 283) && (m_ItemType <= 286)) ||
+ ((m_ItemType >= 290) && (m_ItemType <= 294)) ||
+ (m_ItemType == 325) ||
+ (m_ItemType == 346);
}
diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp
index df2572976..ba901df4e 100644
--- a/src/Mobs/Monster.cpp
+++ b/src/Mobs/Monster.cpp
@@ -325,7 +325,7 @@ void cMonster::Tick(float a_Dt, cChunk & a_Chunk)
AddSpeedZ(Distance.z);
if (m_EMState == ESCAPING)
- { // Runs Faster when escaping :D otherwise they just walk away
+ { // Runs Faster when escaping :D otherwise they just walk away
SetSpeedX (GetSpeedX() * 2.f);
SetSpeedZ (GetSpeedZ() * 2.f);
}
diff --git a/src/OSSupport/Semaphore.cpp b/src/OSSupport/Semaphore.cpp
index 60e5564e4..d919c4744 100644
--- a/src/OSSupport/Semaphore.cpp
+++ b/src/OSSupport/Semaphore.cpp
@@ -44,48 +44,64 @@ cSemaphore::cSemaphore( unsigned int a_MaxCount, unsigned int a_InitialCount /*
#endif
}
+
+
+
+
cSemaphore::~cSemaphore()
{
#ifdef _WIN32
CloseHandle( m_Handle );
#else
- if( m_bNamed )
- {
- if( sem_close( (sem_t*)m_Handle ) != 0 )
- {
- LOG("ERROR: Could not close cSemaphore. (%i)", errno);
- }
- }
- else
- {
- sem_destroy( (sem_t*)m_Handle );
- delete (sem_t*)m_Handle;
- }
+ if( m_bNamed )
+ {
+ if( sem_close( (sem_t*)m_Handle ) != 0 )
+ {
+ LOG("ERROR: Could not close cSemaphore. (%i)", errno);
+ }
+ }
+ else
+ {
+ sem_destroy( (sem_t*)m_Handle );
+ delete (sem_t*)m_Handle;
+ }
m_Handle = 0;
#endif
}
+
+
+
+
void cSemaphore::Wait()
{
#ifndef _WIN32
- if( sem_wait( (sem_t*)m_Handle ) != 0)
- {
- LOG("ERROR: Could not wait for cSemaphore. (%i)", errno);
- }
+ if( sem_wait( (sem_t*)m_Handle ) != 0)
+ {
+ LOG("ERROR: Could not wait for cSemaphore. (%i)", errno);
+ }
#else
WaitForSingleObject( m_Handle, INFINITE);
#endif
}
+
+
+
+
void cSemaphore::Signal()
{
#ifndef _WIN32
if( sem_post( (sem_t*)m_Handle ) != 0 )
{
- LOG("ERROR: Could not signal cSemaphore. (%i)", errno);
+ LOG("ERROR: Could not signal cSemaphore. (%i)", errno);
}
#else
ReleaseSemaphore( m_Handle, 1, NULL );
#endif
}
+
+
+
+
diff --git a/src/OSSupport/Sleep.cpp b/src/OSSupport/Sleep.cpp
index b18d918fa..223a8b855 100644
--- a/src/OSSupport/Sleep.cpp
+++ b/src/OSSupport/Sleep.cpp
@@ -14,6 +14,6 @@ void cSleep::MilliSleep( unsigned int a_MilliSeconds )
#ifdef _WIN32
Sleep(a_MilliSeconds); // Don't tick too much
#else
- usleep(a_MilliSeconds*1000);
+ usleep(a_MilliSeconds*1000);
#endif
}
diff --git a/src/OSSupport/Thread.cpp b/src/OSSupport/Thread.cpp
index 674e37757..084e0810e 100644
--- a/src/OSSupport/Thread.cpp
+++ b/src/OSSupport/Thread.cpp
@@ -91,7 +91,7 @@ void cThread::Start( bool a_bWaitOnDelete /* = true */ )
LOGERROR("ERROR: Could not create thread!");
#else
DWORD ThreadID = 0;
- HANDLE hThread = CreateThread( 0 // security
+ HANDLE hThread = CreateThread(NULL // security
,0 // stack size
, (LPTHREAD_START_ROUTINE) MyThread // function name
,this // parameters
diff --git a/src/Protocol/Protocol125.cpp b/src/Protocol/Protocol125.cpp
index e2960d0c3..1ac035e26 100644
--- a/src/Protocol/Protocol125.cpp
+++ b/src/Protocol/Protocol125.cpp
@@ -760,7 +760,7 @@ void cProtocol125::SendPlayerMoveLook(void)
);
*/
- WriteByte (PACKET_PLAYER_MOVE_LOOK);
+ WriteByte(PACKET_PLAYER_MOVE_LOOK);
cPlayer * Player = m_Client->GetPlayer();
WriteDouble(Player->GetPosX());
WriteDouble(Player->GetStance() + 0.03); // Add a small amount so that the player doesn't start inside a block
@@ -1005,10 +1005,10 @@ void cProtocol125::SendSpawnVehicle(const cEntity & a_Vehicle, char a_VehicleTyp
void cProtocol125::SendStatistics(const cStatManager & a_Manager)
{
/* NOTE:
- * Versions prior to minecraft 1.7 use an incremental statistic sync
- * method. The current setup does not allow us to implement that, because
- * of performance considerations.
- */
+ Versions prior to minecraft 1.7 use an incremental statistic sync
+ method. The current setup does not allow us to implement that, because
+ of performance considerations.
+ */
#if 0
for (unsigned int i = 0; i < (unsigned int)statCount; ++i)
{
@@ -1121,7 +1121,7 @@ void cProtocol125::SendUseBed(const cEntity & a_Entity, int a_BlockX, int a_Bloc
cCSLock Lock(m_CSPacket);
WriteByte(PACKET_USE_BED);
WriteInt (a_Entity.GetUniqueID());
- WriteByte(0); // Unknown byte only 0 has been observed
+ WriteByte(0); // Unknown byte only 0 has been observed
WriteInt (a_BlockX);
WriteByte((Byte)a_BlockY);
WriteInt (a_BlockZ);
@@ -1344,11 +1344,11 @@ int cProtocol125::ParseArmAnim(void)
int cProtocol125::ParseBlockDig(void)
{
- HANDLE_PACKET_READ(ReadChar, char, Status);
+ HANDLE_PACKET_READ(ReadChar, char, Status);
HANDLE_PACKET_READ(ReadBEInt, int, PosX);
- HANDLE_PACKET_READ(ReadByte, Byte, PosY);
+ HANDLE_PACKET_READ(ReadByte, Byte, PosY);
HANDLE_PACKET_READ(ReadBEInt, int, PosZ);
- HANDLE_PACKET_READ(ReadChar, char, BlockFace);
+ HANDLE_PACKET_READ(ReadChar, char, BlockFace);
m_Client->HandleLeftClick(PosX, PosY, PosZ, static_cast<eBlockFace>(BlockFace), Status);
return PARSE_OK;
}
diff --git a/src/Protocol/Protocol17x.cpp b/src/Protocol/Protocol17x.cpp
index 45cda944b..37a9fdf47 100644
--- a/src/Protocol/Protocol17x.cpp
+++ b/src/Protocol/Protocol17x.cpp
@@ -2707,9 +2707,10 @@ void cProtocol172::cPacketizer::WriteEntityMetadata(const cEntity & a_Entity)
// The following expression makes Minecarts shake more with less health or higher damage taken
// It gets half the maximum health, and takes it away from the current health minus the half health:
- /* Health: 5 | 3 - (5 - 3) = 1 (shake power)
- Health: 3 | 3 - (3 - 3) = 3
- Health: 1 | 3 - (1 - 3) = 5
+ /*
+ Health: 5 | 3 - (5 - 3) = 1 (shake power)
+ Health: 3 | 3 - (3 - 3) = 3
+ Health: 1 | 3 - (1 - 3) = 5
*/
WriteInt((((a_Entity.GetMaxHealth() / 2) - (a_Entity.GetHealth() - (a_Entity.GetMaxHealth() / 2))) * ((const cMinecart &)a_Entity).LastDamage()) * 4);
WriteByte(0x52);
diff --git a/src/Simulator/DelayedFluidSimulator.h b/src/Simulator/DelayedFluidSimulator.h
index fe59f6dd6..8a6c26c7a 100644
--- a/src/Simulator/DelayedFluidSimulator.h
+++ b/src/Simulator/DelayedFluidSimulator.h
@@ -70,7 +70,7 @@ protected:
/*
Slots:
| 0 | 1 | ... | m_AddSlotNum | m_SimSlotNum | ... | m_TickDelay - 1 |
- adding blocks here ^ | ^ simulating here
+ | adding blocks here ^ | ^ simulating here
*/
/// Called from SimulateChunk() to simulate each block in one slot of blocks. Descendants override this method to provide custom simulation.
diff --git a/src/Simulator/FluidSimulator.cpp b/src/Simulator/FluidSimulator.cpp
index 99aa11728..499e204a1 100644
--- a/src/Simulator/FluidSimulator.cpp
+++ b/src/Simulator/FluidSimulator.cpp
@@ -137,7 +137,7 @@ Direction cFluidSimulator::GetFlowingDirection(int a_X, int a_Y, int a_Z, bool a
return Y_MINUS;
*/
- NIBBLETYPE LowestPoint = m_World.GetBlockMeta(a_X, a_Y, a_Z); // Current Block Meta so only lower points will be counted
+ NIBBLETYPE LowestPoint = m_World.GetBlockMeta(a_X, a_Y, a_Z); // Current Block Meta so only lower points will be counted
int X = 0, Z = 0; // Lowest Pos will be stored here
if (IsAllowedBlock(m_World.GetBlock(a_X, a_Y + 1, a_Z)) && a_Over) // check for upper block to flow because this also affects the flowing direction
diff --git a/src/Simulator/IncrementalRedstoneSimulator.cpp b/src/Simulator/IncrementalRedstoneSimulator.cpp
index eb12c08e0..8e5e40fb5 100644
--- a/src/Simulator/IncrementalRedstoneSimulator.cpp
+++ b/src/Simulator/IncrementalRedstoneSimulator.cpp
@@ -739,7 +739,7 @@ void cIncrementalRedstoneSimulator::HandleRedstoneRepeater(int a_RelBlockX, int
// Create a variable holding my meta to avoid multiple lookups.
NIBBLETYPE a_Meta = m_Chunk->GetMeta(a_RelBlockX, a_RelBlockY, a_RelBlockZ);
bool IsOn = (a_MyState == E_BLOCK_REDSTONE_REPEATER_ON);
-
+
if (!IsRepeaterLocked(a_RelBlockX, a_RelBlockY, a_RelBlockZ, a_Meta)) // If we're locked, change nothing. Otherwise:
{
bool IsSelfPowered = IsRepeaterPowered(a_RelBlockX, a_RelBlockY, a_RelBlockZ, a_Meta);
diff --git a/src/Simulator/IncrementalRedstoneSimulator.h b/src/Simulator/IncrementalRedstoneSimulator.h
index 878f88b71..79740a8f6 100644
--- a/src/Simulator/IncrementalRedstoneSimulator.h
+++ b/src/Simulator/IncrementalRedstoneSimulator.h
@@ -294,7 +294,7 @@ private:
case E_BLOCK_WOODEN_PRESSURE_PLATE:
case E_BLOCK_PISTON:
{
- return true;
+ return true;
}
default: return false;
}
diff --git a/src/UI/SlotArea.h b/src/UI/SlotArea.h
index 3dc5c3849..7f37159b7 100644
--- a/src/UI/SlotArea.h
+++ b/src/UI/SlotArea.h
@@ -135,7 +135,7 @@ class cSlotAreaHotBar :
typedef cSlotAreaInventoryBase super;
public:
- cSlotAreaHotBar(cWindow & a_ParentWindow) :
+ cSlotAreaHotBar(cWindow & a_ParentWindow) :
cSlotAreaInventoryBase(cInventory::invHotbarCount, cInventory::invHotbarOffset, a_ParentWindow)
{
}
@@ -150,7 +150,7 @@ class cSlotAreaArmor :
public cSlotAreaInventoryBase
{
public:
- cSlotAreaArmor(cWindow & a_ParentWindow) :
+ cSlotAreaArmor(cWindow & a_ParentWindow) :
cSlotAreaInventoryBase(cInventory::invArmorCount, cInventory::invArmorOffset, a_ParentWindow)
{
}
diff --git a/src/WorldStorage/MapSerializer.h b/src/WorldStorage/MapSerializer.h
index eb7678a08..4fa40f6f9 100644
--- a/src/WorldStorage/MapSerializer.h
+++ b/src/WorldStorage/MapSerializer.h
@@ -52,10 +52,9 @@ private:
/** Utility class used to serialize item ID counts.
- *
- * In order to perform bounds checking (while loading),
- * the last registered ID of each item is serialized to an NBT file.
- */
+In order to perform bounds checking (while loading),
+the last registered ID of each item is serialized to an NBT file.
+*/
class cIDCountSerializer
{
public: