Fixed spaces around single-line comments.
There should be at least two spaces in front and one space after //-style comments.
This commit is contained in:
parent
993fd14ddf
commit
7fff12bfac
|
@ -448,7 +448,7 @@ void cChunk::CollectMobCensus(cMobCensus& toFill)
|
|||
Vector3d currentPosition;
|
||||
for (cEntityList::iterator itr = m_Entities.begin(); itr != m_Entities.end(); ++itr)
|
||||
{
|
||||
//LOGD("Counting entity #%i (%s)", (*itr)->GetUniqueID(), (*itr)->GetClass());
|
||||
// LOGD("Counting entity #%i (%s)", (*itr)->GetUniqueID(), (*itr)->GetClass());
|
||||
if ((*itr)->IsMob())
|
||||
{
|
||||
cMonster& Monster = (cMonster&)(**itr);
|
||||
|
@ -1727,7 +1727,7 @@ void cChunk::CollectPickupsByPlayer(cPlayer * a_Player)
|
|||
{
|
||||
if ((!(*itr)->IsPickup()) && (!(*itr)->IsProjectile()))
|
||||
{
|
||||
continue; // Only pickups and projectiles
|
||||
continue; // Only pickups and projectiles can be picked up
|
||||
}
|
||||
float DiffX = (float)((*itr)->GetPosX() - PosX );
|
||||
float DiffY = (float)((*itr)->GetPosY() - PosY );
|
||||
|
|
|
@ -274,7 +274,6 @@ public:
|
|||
|
||||
void UseBlockEntity(cPlayer * a_Player, int a_X, int a_Y, int a_Z); // [x, y, z] in world block coords
|
||||
|
||||
void CalculateLighting(); // Recalculate right now
|
||||
void CalculateHeightmap(const BLOCKTYPE * a_BlockTypes);
|
||||
|
||||
// Broadcast various packets to all clients of this chunk:
|
||||
|
|
|
@ -138,9 +138,9 @@ public:
|
|||
{
|
||||
#if AXIS_ORDER == AXIS_ORDER_XZY
|
||||
// For some reason, NOT using the Horner schema is faster. Weird.
|
||||
return x + (z * cChunkDef::Width) + (y * cChunkDef::Width * cChunkDef::Width); // 1.2 is XZY
|
||||
return x + (z * cChunkDef::Width) + (y * cChunkDef::Width * cChunkDef::Width); // 1.2 uses XZY
|
||||
#elif AXIS_ORDER == AXIS_ORDER_YZX
|
||||
return y + (z * cChunkDef::Width) + (x * cChunkDef::Height * cChunkDef::Width); // 1.1 is YZX
|
||||
return y + (z * cChunkDef::Width) + (x * cChunkDef::Height * cChunkDef::Width); // 1.1 uses YZX
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -33,12 +33,13 @@
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
// cChunkMap:
|
||||
|
||||
cChunkMap::cChunkMap(cWorld * a_World )
|
||||
: m_World( a_World ),
|
||||
cChunkMap::cChunkMap(cWorld * a_World) :
|
||||
m_World(a_World),
|
||||
m_Pool(
|
||||
new cListAllocationPool<cChunkData::sChunkSection, 1600>(
|
||||
std::auto_ptr<cAllocationPool<cChunkData::sChunkSection>::cStarvationCallbacks>(
|
||||
new cStarvationCallbacks())
|
||||
new cStarvationCallbacks()
|
||||
)
|
||||
)
|
||||
)
|
||||
{
|
||||
|
@ -2733,7 +2734,7 @@ cChunkMap::cChunkLayer::~cChunkLayer()
|
|||
for (size_t i = 0; i < ARRAYCOUNT(m_Chunks); ++i)
|
||||
{
|
||||
delete m_Chunks[i];
|
||||
m_Chunks[i] = NULL; // // Must zero out, because further chunk deletions query the chunkmap for entities and that would touch deleted data
|
||||
m_Chunks[i] = NULL; // Must zero out, because further chunk deletions query the chunkmap for entities and that would touch deleted data
|
||||
} // for i - m_Chunks[]
|
||||
}
|
||||
|
||||
|
|
|
@ -1457,8 +1457,10 @@ void cClientHandle::HandleAnimation(char a_Animation)
|
|||
break;
|
||||
}
|
||||
default: // Anything else is the same
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
m_Player->GetWorld()->BroadcastEntityAnimation(*m_Player, a_Animation, this);
|
||||
}
|
||||
|
|
|
@ -271,15 +271,14 @@ public:
|
|||
|
||||
private:
|
||||
|
||||
/** Handles the block placing packet when it is a real block placement (not block-using, item-using or eating) */
|
||||
void HandlePlaceBlock(int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ, cItemHandler & a_ItemHandler);
|
||||
|
||||
/** The type used for storing the names of registered plugin channels. */
|
||||
typedef std::set<AString> cChannels;
|
||||
|
||||
int m_ViewDistance; // Number of chunks the player can see in each direction; 4 is the minimum ( http://wiki.vg/Protocol_FAQ#.E2.80.A6all_connecting_clients_spasm_and_jerk_uncontrollably.21 )
|
||||
/** Number of chunks the player can see in each direction; 4 is the minimum ( http://wiki.vg/Protocol_FAQ#.E2.80.A6all_connecting_clients_spasm_and_jerk_uncontrollably.21 ) */
|
||||
int m_ViewDistance;
|
||||
|
||||
static const int GENERATEDISTANCE = 2; // Server generates this many chunks AHEAD of player sight. 2 is the minimum, since foliage is generated 1 step behind chunk terrain generation
|
||||
/** Server generates this many chunks AHEAD of player sight. */
|
||||
static const int GENERATEDISTANCE = 2;
|
||||
|
||||
AString m_IPString;
|
||||
|
||||
|
@ -317,7 +316,7 @@ private:
|
|||
int m_PingID;
|
||||
long long m_PingStartTime;
|
||||
long long m_LastPingTime;
|
||||
static const unsigned short PING_TIME_MS = 1000; //minecraft sends 1 per 20 ticks (1 second or every 1000 ms)
|
||||
static const unsigned short PING_TIME_MS = 1000; // Vanilla sends 1 per 20 ticks (1 second or every 1000 ms)
|
||||
|
||||
// Values required for block dig animation
|
||||
int m_BlockDigAnimStage; // Current stage of the animation; -1 if not digging
|
||||
|
@ -374,6 +373,9 @@ private:
|
|||
cChannels m_PluginChannels;
|
||||
|
||||
|
||||
/** Handles the block placing packet when it is a real block placement (not block-using, item-using or eating) */
|
||||
void HandlePlaceBlock(int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ, cItemHandler & a_ItemHandler);
|
||||
|
||||
/** Returns true if the rate block interactions is within a reasonable limit (bot protection) */
|
||||
bool CheckBlockInteractionsRate(void);
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ typedef std::vector<int> cSlotNums;
|
|||
/// Experience Orb setup
|
||||
enum
|
||||
{
|
||||
//open to suggestion on naming convention here :)
|
||||
// Open to suggestion on naming convention here :)
|
||||
MAX_EXPERIENCE_ORB_SIZE = 2000
|
||||
} ;
|
||||
|
||||
|
|
|
@ -493,7 +493,7 @@ bool cInventory::AddToBar( cItem & a_Item, const int a_Offset, const int a_Size,
|
|||
if( NumFree >= a_Item.m_ItemCount )
|
||||
{
|
||||
|
||||
//printf("1. Adding %i items ( free: %i )\n", a_Item.m_ItemCount, NumFree );
|
||||
// printf("1. Adding %i items ( free: %i )\n", a_Item.m_ItemCount, NumFree );
|
||||
m_Slots[i + a_Offset].m_ItemCount += a_Item.m_ItemCount;
|
||||
a_Item.m_ItemCount = 0;
|
||||
a_bChangedSlots[i + a_Offset] = true;
|
||||
|
@ -501,7 +501,7 @@ bool cInventory::AddToBar( cItem & a_Item, const int a_Offset, const int a_Size,
|
|||
}
|
||||
else
|
||||
{
|
||||
//printf("2. Adding %i items\n", NumFree );
|
||||
// printf("2. Adding %i items\n", NumFree );
|
||||
m_Slots[i + a_Offset].m_ItemCount += (char)NumFree;
|
||||
a_Item.m_ItemCount -= (char)NumFree;
|
||||
a_bChangedSlots[i + a_Offset] = true;
|
||||
|
|
|
@ -130,9 +130,9 @@ void cLog::Log(const char * a_Format, va_list argList)
|
|||
|
||||
// Print to console:
|
||||
#if defined(ANDROID_NDK)
|
||||
//__android_log_vprint(ANDROID_LOG_ERROR,"MCServer", a_Format, argList);
|
||||
// __android_log_vprint(ANDROID_LOG_ERROR,"MCServer", a_Format, argList);
|
||||
__android_log_print(ANDROID_LOG_ERROR, "MCServer", "%s", Line.c_str() );
|
||||
//CallJavaFunction_Void_String(g_JavaThread, "AddToLog", Line );
|
||||
// CallJavaFunction_Void_String(g_JavaThread, "AddToLog", Line );
|
||||
#else
|
||||
printf("%s", Line.c_str());
|
||||
#endif
|
||||
|
|
|
@ -19,7 +19,7 @@ void cMobCensus::CollectMob(cMonster & a_Monster, cChunk & a_Chunk, double a_Dis
|
|||
|
||||
bool cMobCensus::IsCapped(cMonster::eFamily a_MobFamily)
|
||||
{
|
||||
const int ratio = 319; // this should be 256 as we are only supposed to take account from chunks that are in 17x17 from a player
|
||||
const int ratio = 319; // This should be 256 as we are only supposed to take account from chunks that are in 17x17 from a player
|
||||
// but for now, we use all chunks loaded by players. that means 19 x 19 chunks. That's why we use 256 * (19*19) / (17*17) = 319
|
||||
// MG TODO : code the correct count
|
||||
if ((GetCapMultiplier(a_MobFamily) * GetNumChunks()) / ratio >= m_MobFamilyCollecter.GetNumberOfCollectedMobs(a_MobFamily))
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include <map>
|
||||
#include <set>
|
||||
#include "BlockID.h"
|
||||
#include "Mobs/Monster.h" //this is a side-effect of keeping Mobfamily inside Monster class. I'd prefer to keep both (Mobfamily and Monster) inside a "Monster" namespace MG TODO : do it
|
||||
#include "Mobs/Monster.h" // This is a side-effect of keeping Mobfamily inside Monster class. I'd prefer to keep both (Mobfamily and Monster) inside a "Monster" namespace MG TODO : do it
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ cMobProximityCounter::sIterablePair cMobProximityCounter::getMobWithinThosesDist
|
|||
{
|
||||
if ((a_DistanceMin == 1) || (itr->first > a_DistanceMin))
|
||||
{
|
||||
toReturn.m_Begin = itr; // this is the first one with distance > a_DistanceMin;
|
||||
toReturn.m_Begin = itr; // This is the first one with distance > a_DistanceMin;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -69,7 +69,7 @@ cMobProximityCounter::sIterablePair cMobProximityCounter::getMobWithinThosesDist
|
|||
{
|
||||
if ((a_DistanceMax != 1) && (itr->first > a_DistanceMax))
|
||||
{
|
||||
toReturn.m_End = itr; // this is just after the last one with distance < a_DistanceMax
|
||||
toReturn.m_End = itr; // This is just after the last one with distance < a_DistanceMax
|
||||
// Note : if we are not going through this, it's ok, toReturn.m_End will be end();
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include "ChunkDef.h"
|
||||
#include "Chunk.h"
|
||||
#include "FastRandom.h"
|
||||
#include "Mobs/Monster.h" //this is a side-effect of keeping Mobfamily inside Monster class. I'd prefer to keep both (Mobfamily and Monster) inside a "Monster" namespace MG TODO : do it
|
||||
#include "Mobs/Monster.h" // This is a side-effect of keeping Mobfamily inside Monster class. I'd prefer to keep both (Mobfamily and Monster) inside a "Monster" namespace MG TODO : do it
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#include "Entities/Entity.h"
|
||||
|
||||
#ifndef _WIN32
|
||||
#include <stdlib.h> // abs()
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -247,7 +247,7 @@ bool cTracer::Trace( const Vector3f & a_Start, const Vector3f & a_Direction, int
|
|||
// return 1 = hit, other is not hit
|
||||
int LinesCross(float x0,float y0,float x1,float y1,float x2,float y2,float x3,float y3)
|
||||
{
|
||||
//float linx, liny;
|
||||
// float linx, liny;
|
||||
|
||||
float d=(x1-x0)*(y3-y2)-(y1-y0)*(x3-x2);
|
||||
if (abs(d)<0.001) {return 0;}
|
||||
|
@ -257,8 +257,8 @@ int LinesCross(float x0,float y0,float x1,float y1,float x2,float y2,float x3,fl
|
|||
float CD=((y0-y2)*(x1-x0)-(x0-x2)*(y1-y0))/d;
|
||||
if (CD>=0.0 && CD<=1.0)
|
||||
{
|
||||
//linx=x0+AB*(x1-x0);
|
||||
//liny=y0+AB*(y1-y0);
|
||||
// linx=x0+AB*(x1-x0);
|
||||
// liny=y0+AB*(y1-y0);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
@ -291,7 +291,7 @@ int cTracer::intersect3D_SegmentPlane( const Vector3f & a_Origin, const Vector3f
|
|||
if (sI < 0 || sI > 1)
|
||||
return 0; // no intersection
|
||||
|
||||
//Vector3f I ( a_Ray->GetOrigin() + sI * u );//S.P0 + sI * u; // compute segment intersect point
|
||||
// Vector3f I ( a_Ray->GetOrigin() + sI * u );//S.P0 + sI * u; // compute segment intersect point
|
||||
RealHit = a_Origin + u * sI;
|
||||
return 1;
|
||||
}
|
||||
|
@ -311,7 +311,7 @@ int cTracer::GetHitNormal(const Vector3f & start, const Vector3f & end, const Ve
|
|||
Look.Normalize();
|
||||
|
||||
float dot = Look.Dot( Vector3f(-1, 0, 0) ); // first face normal is x -1
|
||||
if(dot < 0)
|
||||
if (dot < 0)
|
||||
{
|
||||
int Lines = LinesCross( start.x, start.y, end.x, end.y, BlockPos.x, BlockPos.y, BlockPos.x, BlockPos.y + 1 );
|
||||
if(Lines == 1)
|
||||
|
|
|
@ -375,17 +375,15 @@ void cWorld::SetNextBlockTick(int a_BlockX, int a_BlockY, int a_BlockZ)
|
|||
|
||||
void cWorld::InitializeSpawn(void)
|
||||
{
|
||||
if (!m_IsSpawnExplicitlySet) // Check if spawn position was already explicitly set or not
|
||||
if (!m_IsSpawnExplicitlySet)
|
||||
{
|
||||
GenerateRandomSpawn(); // Generate random solid-land coordinate and then write it to the world configuration
|
||||
|
||||
// Spawn position wasn't already explicitly set, enerate random solid-land coordinate and then write it to the world configuration:
|
||||
GenerateRandomSpawn();
|
||||
cIniFile IniFile;
|
||||
IniFile.ReadFile(m_IniFileName);
|
||||
|
||||
IniFile.SetValueF("SpawnPosition", "X", m_SpawnX);
|
||||
IniFile.SetValueF("SpawnPosition", "Y", m_SpawnY);
|
||||
IniFile.SetValueF("SpawnPosition", "Z", m_SpawnZ);
|
||||
|
||||
IniFile.WriteFile(m_IniFileName);
|
||||
}
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
|
||||
#include "Root.h"
|
||||
|
||||
#include <exception> //std::exception
|
||||
#include <csignal> //std::signal
|
||||
#include <stdlib.h> //exit()
|
||||
#include <exception>
|
||||
#include <csignal>
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#include <dbghelp.h>
|
||||
|
|
Loading…
Reference in New Issue