More style checking.
Spaces around some operators are checked.
This commit is contained in:
parent
61300ab9ef
commit
c13b1931ff
@ -19,13 +19,13 @@ extern "C"
|
||||
#include "../Entities/Entity.h"
|
||||
#include "../BlockEntities/BlockEntity.h"
|
||||
|
||||
// fwd: SQLite/lsqlite3.c
|
||||
// fwd: "SQLite/lsqlite3.c"
|
||||
extern "C"
|
||||
{
|
||||
int luaopen_lsqlite3(lua_State * L);
|
||||
}
|
||||
|
||||
// fwd: LuaExpat/lxplib.c:
|
||||
// fwd: "LuaExpat/lxplib.c":
|
||||
extern "C"
|
||||
{
|
||||
int luaopen_lxp(lua_State * L);
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
|
||||
|
||||
// fwd: UI/Window.h
|
||||
// fwd: "UI/Window.h"
|
||||
class cWindow;
|
||||
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
// MobHeadEntity.cpp
|
||||
|
||||
// Implements the cMobHeadEntity class representing a single skull/head in the world
|
||||
// Implements the cMobHeadEntity class representing a single skull / head in the world
|
||||
|
||||
#include "Globals.h"
|
||||
#include "MobHeadEntity.h"
|
||||
|
@ -1,6 +1,6 @@
|
||||
// MobHeadEntity.h
|
||||
|
||||
// Declares the cMobHeadEntity class representing a single skull/head in the world
|
||||
// Declares the cMobHeadEntity class representing a single skull / head in the world
|
||||
|
||||
|
||||
|
||||
|
@ -22,7 +22,7 @@ public:
|
||||
virtual void OnUse(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ) override
|
||||
{
|
||||
NIBBLETYPE Meta = a_ChunkInterface.GetBlockMeta(a_BlockX, a_BlockY, a_BlockZ);
|
||||
Meta ^= 0x04; // Toggle 3rd (addition/subtraction) bit with XOR
|
||||
Meta ^= 0x04; // Toggle 3rd (addition / subtraction) bit with XOR
|
||||
a_ChunkInterface.SetBlockMeta(a_BlockX, a_BlockY, a_BlockZ, Meta);
|
||||
}
|
||||
|
||||
|
@ -134,7 +134,7 @@ NIBBLETYPE cBlockDoorHandler::MetaMirrorXY(NIBBLETYPE a_Meta)
|
||||
return a_Meta;
|
||||
}
|
||||
|
||||
// Holds open/closed meta data. 0x0C == 1100.
|
||||
// Holds open / closed meta data. 0x0C == 1100.
|
||||
NIBBLETYPE OtherMeta = a_Meta & 0x0C;
|
||||
|
||||
// Mirrors according to a table. 0x03 == 0011.
|
||||
@ -152,7 +152,7 @@ NIBBLETYPE cBlockDoorHandler::MetaMirrorXY(NIBBLETYPE a_Meta)
|
||||
|
||||
NIBBLETYPE cBlockDoorHandler::MetaMirrorYZ(NIBBLETYPE a_Meta)
|
||||
{
|
||||
// Top bit (0x08) contains door panel type (Top/Bottom panel) Only Bottom panels contain position data
|
||||
// Top bit (0x08) contains door panel type (Top / Bottom panel) Only Bottom panels contain position data
|
||||
// Return a_Meta if panel is a top panel (0x08 bit is set to 1)
|
||||
|
||||
// Note: Currently, you can not properly mirror the hinges on a double door. The orientation of the door is stored
|
||||
@ -165,7 +165,7 @@ NIBBLETYPE cBlockDoorHandler::MetaMirrorYZ(NIBBLETYPE a_Meta)
|
||||
return a_Meta;
|
||||
}
|
||||
|
||||
// Holds open/closed meta data. 0x0C == 1100.
|
||||
// Holds open / closed meta data. 0x0C == 1100.
|
||||
NIBBLETYPE OtherMeta = a_Meta & 0x0C;
|
||||
|
||||
// Mirrors according to a table. 0x03 == 0011.
|
||||
|
@ -106,7 +106,7 @@ public:
|
||||
void FindAndSetPortalFrame(int X, int Y, int Z, cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface)
|
||||
{
|
||||
int MaxY = FindObsidianCeiling(X, Y, Z, a_ChunkInterface); // Get topmost obsidian block as reference for all other checks
|
||||
int X1 = X + 1, Z1 = Z + 1, X2 = X - 1, Z2 = Z - 1; // Duplicate XZ values, add/subtract one as we've checked the original already the line above
|
||||
int X1 = X + 1, Z1 = Z + 1, X2 = X - 1, Z2 = Z - 1; // Duplicate XZ values, add / subtract one as we've checked the original already the line above
|
||||
|
||||
if (MaxY == 0) // Oh noes! Not a portal coordinate :(
|
||||
{
|
||||
@ -139,7 +139,7 @@ public:
|
||||
return;
|
||||
}
|
||||
|
||||
/** Evaluates if coordinates are a portal going XP/XM; returns true if so, and writes boundaries to variable
|
||||
/** Evaluates if coordinates are a portal going XP / XM; returns true if so, and writes boundaries to variable
|
||||
Takes coordinates of base block and Y coord of target obsidian ceiling */
|
||||
bool FindPortalSliceX(int X1, int X2, int Y, int Z, int MaxY, cChunkInterface & a_ChunkInterface)
|
||||
{
|
||||
@ -179,7 +179,7 @@ public:
|
||||
return (FoundFrameXP && FoundFrameXM);
|
||||
}
|
||||
|
||||
/// Evaluates if coords are a portal going ZP/ZM; returns true if so, and writes boundaries to variable
|
||||
/// Evaluates if coords are a portal going ZP / ZM; returns true if so, and writes boundaries to variable
|
||||
bool FindPortalSliceZ(int X, int Y, int Z1, int Z2, int MaxY, cChunkInterface & a_ChunkInterface)
|
||||
{
|
||||
Dir = 2;
|
||||
|
@ -19,7 +19,7 @@ public:
|
||||
|
||||
virtual void OnUse(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ) override
|
||||
{
|
||||
// Flip the ON bit on/off using the XOR bitwise operation
|
||||
// Flip the ON bit on / off using the XOR bitwise operation
|
||||
NIBBLETYPE Meta = (a_ChunkInterface.GetBlockMeta(a_BlockX, a_BlockY, a_BlockZ) ^ 0x08);
|
||||
|
||||
a_ChunkInterface.SetBlockMeta(a_BlockX, a_BlockY, a_BlockZ, Meta);
|
||||
|
@ -108,7 +108,7 @@ private:
|
||||
case E_BLOCK_ENCHANTMENT_TABLE:
|
||||
case E_BLOCK_END_PORTAL:
|
||||
case E_BLOCK_END_PORTAL_FRAME:
|
||||
// Notice the lack of an E_BLOCK_ENDER_CHEST here; its because ender chests can totally be pushed/pulled in MCS :)
|
||||
// Notice the lack of an E_BLOCK_ENDER_CHEST here; its because ender chests can totally be pushed / pulled in MCS :)
|
||||
case E_BLOCK_FURNACE:
|
||||
case E_BLOCK_LIT_FURNACE:
|
||||
case E_BLOCK_INVERTED_DAYLIGHT_SENSOR:
|
||||
|
@ -502,11 +502,11 @@ public:
|
||||
// Save powered rail flag.
|
||||
NIBBLETYPE OtherMeta = a_Meta & 0x08;
|
||||
// Rotates according to table; 0x07 == 0111.
|
||||
// Rails can either be flat (North/South) or Ascending (Asc. East)
|
||||
// Rails can either be flat (North / South) or Ascending (Asc. East)
|
||||
switch (a_Meta & 0x07)
|
||||
{
|
||||
case 0x00: return 0x01 + OtherMeta; // North/South -> East/West
|
||||
case 0x01: return 0x00 + OtherMeta; // East/West -> North/South
|
||||
case 0x00: return 0x01 + OtherMeta; // North / South -> East / West
|
||||
case 0x01: return 0x00 + OtherMeta; // East / West -> North / South
|
||||
|
||||
case 0x02: return 0x04 + OtherMeta; // Asc. East -> Asc. North
|
||||
case 0x04: return 0x03 + OtherMeta; // Asc. North -> Asc. West
|
||||
@ -538,11 +538,11 @@ public:
|
||||
// Save powered rail flag.
|
||||
NIBBLETYPE OtherMeta = a_Meta & 0x08;
|
||||
// Rotates according to table; 0x07 == 0111.
|
||||
// Rails can either be flat (North/South) or Ascending (Asc. East)
|
||||
// Rails can either be flat (North / South) or Ascending (Asc. East)
|
||||
switch (a_Meta & 0x07)
|
||||
{
|
||||
case 0x00: return 0x01 + OtherMeta; // North/South -> East/West
|
||||
case 0x01: return 0x00 + OtherMeta; // East/West -> North/South
|
||||
case 0x00: return 0x01 + OtherMeta; // North / South -> East / West
|
||||
case 0x01: return 0x00 + OtherMeta; // East / West -> North / South
|
||||
|
||||
case 0x02: return 0x05 + OtherMeta; // Asc. East -> Asc. South
|
||||
case 0x05: return 0x03 + OtherMeta; // Asc. South -> Asc. West
|
||||
@ -574,7 +574,7 @@ public:
|
||||
// Save powered rail flag.
|
||||
NIBBLETYPE OtherMeta = a_Meta & 0x08;
|
||||
// Mirrors according to table; 0x07 == 0111.
|
||||
// Rails can either be flat (North/South) or Ascending (Asc. East)
|
||||
// Rails can either be flat (North / South) or Ascending (Asc. East)
|
||||
switch (a_Meta & 0x07)
|
||||
{
|
||||
case 0x05: return 0x04 + OtherMeta; // Asc. South -> Asc. North
|
||||
@ -605,7 +605,7 @@ public:
|
||||
// Save powered rail flag.
|
||||
NIBBLETYPE OtherMeta = a_Meta & 0x08;
|
||||
// Mirrors according to table; 0x07 == 0111.
|
||||
// Rails can either be flat (North/South) or Ascending (Asc. East)
|
||||
// Rails can either be flat (North / South) or Ascending (Asc. East)
|
||||
switch (a_Meta & 0x07)
|
||||
{
|
||||
case 0x02: return 0x03 + OtherMeta; // Asc. East -> Asc. West
|
||||
|
@ -35,7 +35,7 @@ public:
|
||||
return;
|
||||
}
|
||||
|
||||
// Flip the ON bit on/off using the XOR bitwise operation
|
||||
// Flip the ON bit on / off using the XOR bitwise operation
|
||||
NIBBLETYPE Meta = (a_ChunkInterface.GetBlockMeta(a_BlockX, a_BlockY, a_BlockZ) ^ 0x04);
|
||||
a_ChunkInterface.SetBlockMeta(a_BlockX, a_BlockY, a_BlockZ, Meta);
|
||||
|
||||
|
@ -57,10 +57,10 @@ public:
|
||||
/// Returns true if a boundingbox specified by a_Min and a_Max is inside this bounding box
|
||||
bool IsInside(const Vector3d & a_Min, const Vector3d & a_Max);
|
||||
|
||||
/// Returns true if the specified point is inside the bounding box specified by its min/max corners
|
||||
/// Returns true if the specified point is inside the bounding box specified by its min / max corners
|
||||
static bool IsInside(const Vector3d & a_Min, const Vector3d & a_Max, const Vector3d & a_Point);
|
||||
|
||||
/// Returns true if the specified point is inside the bounding box specified by its min/max corners
|
||||
/// Returns true if the specified point is inside the bounding box specified by its min / max corners
|
||||
static bool IsInside(const Vector3d & a_Min, const Vector3d & a_Max, double a_X, double a_Y, double a_Z);
|
||||
|
||||
/** Returns true if this bounding box is intersected by the line specified by its two points
|
||||
|
@ -149,6 +149,27 @@ local g_ViolationPatterns =
|
||||
|
||||
-- No space before a closing parenthesis:
|
||||
{" %)", "Remove the space before \")\""},
|
||||
|
||||
-- Check spaces around "+":
|
||||
{"^[a-zA-Z0-9]+%+[a-zA-Z0-9]+", "Add space around +"},
|
||||
{"[!@#$%%%^&*() %[%]\t][a-zA-Z0-9]+%+[a-zA-Z0-9]+", "Add space around +"},
|
||||
--[[
|
||||
-- Cannot check these because of text such as "X+" and "+2" appearing in some comments.
|
||||
{"^[a-zA-Z0-9]+ %+[a-zA-Z0-9]+", "Add space after +"},
|
||||
{"[!@#$%%%^&*() %[%]\t][a-zA-Z0-9]+ %+[a-zA-Z0-9]+", "Add space after +"},
|
||||
{"^[a-zA-Z0-9]+%+ [a-zA-Z0-9]+", "Add space before +"},
|
||||
{"[!@#$%%%^&*() %[%]\t][a-zA-Z0-9]+%+ [a-zA-Z0-9]+", "Add space before +"},
|
||||
--]]
|
||||
|
||||
-- Cannot check spaces around "-", because the minus is sometimes used as a hyphen between-words
|
||||
|
||||
-- Check spaces around "*":
|
||||
{"^[a-zA-Z0-9]+%*[a-zA-Z0-9]+", "Add space around *"},
|
||||
{"^[^\"]*[!@#$%%%^&*() %[%]\t][a-zA-Z0-9]+%*[a-zA-Z0-9]+", "Add space around *"},
|
||||
|
||||
-- Check spaces around "/":
|
||||
{"^[a-zA-Z0-9]+%/[a-zA-Z0-9]+", "Add space around /"},
|
||||
{"^[^\"]*[!@#$%%%^&*() %[%]\t][a-zA-Z0-9]+%/[a-zA-Z0-9]+", "Add space around /"},
|
||||
}
|
||||
|
||||
|
||||
|
@ -737,7 +737,7 @@ void cChunk::ProcessQueuedSetBlocks(void)
|
||||
{
|
||||
if (GetBlock(itr->m_RelX, itr->m_RelY, itr->m_RelZ) == itr->m_PreviousType)
|
||||
{
|
||||
// Current world age is bigger than/equal to target world age - delay time reached AND
|
||||
// Current world age is bigger than / equal to target world age - delay time reached AND
|
||||
// Previous block type was the same as current block type (to prevent duplication)
|
||||
SetBlock(itr->m_RelX, itr->m_RelY, itr->m_RelZ, itr->m_BlockType, itr->m_BlockMeta); // SetMeta doesn't send to client
|
||||
itr = m_SetBlockQueue.erase(itr);
|
||||
@ -751,7 +751,7 @@ void cChunk::ProcessQueuedSetBlocks(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
// Current world age is bigger than/equal to target world age - delay time reached
|
||||
// Current world age is bigger than / equal to target world age - delay time reached
|
||||
SetBlock(itr->m_RelX, itr->m_RelY, itr->m_RelZ, itr->m_BlockType, itr->m_BlockMeta);
|
||||
itr = m_SetBlockQueue.erase(itr);
|
||||
LOGD("Successfully set queued block - previous type ignored");
|
||||
@ -1026,7 +1026,7 @@ void cChunk::GrowMelonPumpkin(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_Bl
|
||||
case E_BLOCK_FARMLAND:
|
||||
{
|
||||
// DEBUG: This is here to catch FS #349 - melons growing over other crops.
|
||||
LOG("Growing melon/pumpkin overwriting %s, growing on %s",
|
||||
LOG("Growing melon / pumpkin overwriting %s, growing on %s",
|
||||
ItemTypeToString(BlockType[CheckType]).c_str(),
|
||||
ItemTypeToString(Soil).c_str()
|
||||
);
|
||||
|
@ -436,7 +436,7 @@ bool cClientHandle::StreamNextChunk(void)
|
||||
{
|
||||
Vector3d Vector = Position + LookVector * cChunkDef::Width * Range;
|
||||
|
||||
// Get the chunk from the x/z coords.
|
||||
// Get the chunk from the x / z coords.
|
||||
int RangeX, RangeZ = 0;
|
||||
cChunkDef::BlockToChunk(FloorC(Vector.x), FloorC(Vector.z), RangeX, RangeZ);
|
||||
|
||||
@ -454,7 +454,7 @@ bool cClientHandle::StreamNextChunk(void)
|
||||
continue;
|
||||
}
|
||||
|
||||
// If the chunk already loading/loaded -> skip
|
||||
// If the chunk already loading / loaded -> skip
|
||||
if (
|
||||
(std::find(m_ChunksToSend.begin(), m_ChunksToSend.end(), Coords) != m_ChunksToSend.end()) ||
|
||||
(std::find(m_LoadedChunks.begin(), m_LoadedChunks.end(), Coords) != m_LoadedChunks.end())
|
||||
@ -492,7 +492,7 @@ bool cClientHandle::StreamNextChunk(void)
|
||||
{
|
||||
cChunkCoords Coords = *itr;
|
||||
|
||||
// If the chunk already loading/loaded -> skip
|
||||
// If the chunk already loading / loaded -> skip
|
||||
if (
|
||||
(std::find(m_ChunksToSend.begin(), m_ChunksToSend.end(), Coords) != m_ChunksToSend.end()) ||
|
||||
(std::find(m_LoadedChunks.begin(), m_LoadedChunks.end(), Coords) != m_LoadedChunks.end())
|
||||
@ -1154,7 +1154,7 @@ void cClientHandle::HandleBlockDigStarted(int a_BlockX, int a_BlockY, int a_Bloc
|
||||
return;
|
||||
}
|
||||
|
||||
// Set the last digging coords to the block being dug, so that they can be checked in DIG_FINISHED to avoid dig/aim bug in the client:
|
||||
// Set the last digging coords to the block being dug, so that they can be checked in DIG_FINISHED to avoid dig / aim bug in the client:
|
||||
m_HasStartedDigging = true;
|
||||
m_LastDigBlockX = a_BlockX;
|
||||
m_LastDigBlockY = a_BlockY;
|
||||
@ -1201,7 +1201,7 @@ void cClientHandle::HandleBlockDigFinished(int a_BlockX, int a_BlockY, int a_Blo
|
||||
(m_LastDigBlockZ != a_BlockZ)
|
||||
)
|
||||
{
|
||||
LOGD("Prevented a dig/aim bug in the client (finish {%d, %d, %d} vs start {%d, %d, %d}, HSD: %s)",
|
||||
LOGD("Prevented a dig / aim bug in the client (finish {%d, %d, %d} vs start {%d, %d, %d}, HSD: %s)",
|
||||
a_BlockX, a_BlockY, a_BlockZ,
|
||||
m_LastDigBlockX, m_LastDigBlockY, m_LastDigBlockZ,
|
||||
(m_HasStartedDigging ? "True" : "False")
|
||||
@ -1359,7 +1359,7 @@ void cClientHandle::HandleRightClick(int a_BlockX, int a_BlockY, int a_BlockZ, e
|
||||
|
||||
if (!CheckBlockInteractionsRate())
|
||||
{
|
||||
Kick("Too many blocks were placed/interacted with per unit time - hacked client?");
|
||||
Kick("Too many blocks were placed / interacted with per unit time - hacked client?");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -391,7 +391,7 @@ private:
|
||||
|
||||
cPlayer * m_Player;
|
||||
|
||||
bool m_HasSentDC; ///< True if a D/C packet has been sent in either direction
|
||||
bool m_HasSentDC; ///< True if a Disconnect packet has been sent in either direction
|
||||
|
||||
// Chunk position when the last StreamChunks() was called; used to avoid re-streaming while in the same chunk
|
||||
int m_LastStreamedChunkX;
|
||||
@ -416,7 +416,7 @@ private:
|
||||
int m_BlockDigAnimY;
|
||||
int m_BlockDigAnimZ;
|
||||
|
||||
// To avoid dig/aim bug in the client, store the last position given in a DIG_START packet and compare to that when processing the DIG_FINISH packet:
|
||||
// To avoid dig / aim bug in the client, store the last position given in a DIG_START packet and compare to that when processing the DIG_FINISH packet:
|
||||
bool m_HasStartedDigging;
|
||||
int m_LastDigBlockX;
|
||||
int m_LastDigBlockY;
|
||||
|
@ -229,7 +229,7 @@ inline const char * ClickActionToString(eClickAction a_ClickAction)
|
||||
|
||||
|
||||
|
||||
/** Returns a blockface mirrored around the Y axis (doesn't change up/down). */
|
||||
/** Returns a blockface mirrored around the Y axis (doesn't change up / down). */
|
||||
inline eBlockFace MirrorBlockFaceY(eBlockFace a_BlockFace)
|
||||
{
|
||||
switch (a_BlockFace)
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
|
||||
|
||||
// fwd: WorldStorage/FastNBT.h
|
||||
// fwd: "WorldStorage/FastNBT.h"
|
||||
class cFastNBTWriter;
|
||||
class cParsedNBT;
|
||||
|
||||
|
@ -1309,7 +1309,8 @@ bool cEntity::DetectPortal()
|
||||
|
||||
if (IsPlayer())
|
||||
{
|
||||
((cPlayer *)this)->GetClientHandle()->SendRespawn(dimOverworld); // Send a respawn packet before world is loaded/generated so the client isn't left in limbo
|
||||
// Send a respawn packet before world is loaded / generated so the client isn't left in limbo
|
||||
((cPlayer *)this)->GetClientHandle()->SendRespawn(dimOverworld);
|
||||
}
|
||||
|
||||
return MoveToWorld(cRoot::Get()->CreateAndInitializeWorld(GetWorld()->GetLinkedOverworldName()), false);
|
||||
@ -1688,8 +1689,8 @@ void cEntity::BroadcastMovementUpdate(const cClientHandle * a_Exclude)
|
||||
{
|
||||
m_World->BroadcastEntityRelMove(*this, (char)DiffX, (char)DiffY, (char)DiffZ, a_Exclude);
|
||||
}
|
||||
// Clients seem to store two positions, one for the velocity packet and one for the teleport/relmove packet
|
||||
// The latter is only changed with a relmove/teleport, and m_LastPos stores this position
|
||||
// Clients seem to store two positions, one for the velocity packet and one for the teleport / relmove packet
|
||||
// The latter is only changed with a relmove / teleport, and m_LastPos stores this position
|
||||
m_LastPos = GetPosition();
|
||||
}
|
||||
else
|
||||
|
@ -474,7 +474,7 @@ protected:
|
||||
static cCriticalSection m_CSCount;
|
||||
static UInt32 m_EntityCount;
|
||||
|
||||
/** Measured in meter/second (m/s) */
|
||||
/** Measured in meters / second (m / s) */
|
||||
Vector3d m_Speed;
|
||||
|
||||
/** The ID of the entity that is guaranteed to be unique within a single run of the server.
|
||||
@ -494,7 +494,7 @@ protected:
|
||||
/** Stores whether head yaw has been set manually */
|
||||
bool m_bDirtyHead;
|
||||
|
||||
/** Stores whether our yaw/pitch/roll (body orientation) has been set manually */
|
||||
/** Stores whether our yaw / pitch / roll (body orientation) has been set manually */
|
||||
bool m_bDirtyOrientation;
|
||||
|
||||
/** Stores whether we have sent a Velocity packet with a speed of zero (no speed) to the client
|
||||
|
@ -102,11 +102,11 @@ int cEntityEffect::GetPotionEffectDuration(short a_ItemDamage)
|
||||
// If potion is level II, half the duration. If not, stays the same
|
||||
TierCoeff = (GetPotionEffectIntensity(a_ItemDamage) > 0) ? 0.5 : 1;
|
||||
|
||||
// If potion is extended, multiply duration by 8/3. If not, stays the same
|
||||
// If potion is extended, multiply duration by 8 / 3. If not, stays the same
|
||||
// Extended potion if sixth lowest bit is set
|
||||
ExtCoeff = (a_ItemDamage & 0x40) ? (8.0 / 3.0) : 1;
|
||||
|
||||
// If potion is splash potion, multiply duration by 3/4. If not, stays the same
|
||||
// If potion is splash potion, multiply duration by 3 / 4. If not, stays the same
|
||||
SplashCoeff = IsPotionDrinkable(a_ItemDamage) ? 1 : 0.75;
|
||||
|
||||
// Ref.:
|
||||
|
@ -905,7 +905,7 @@ bool cMinecart::TestEntityCollision(NIBBLETYPE a_RailMeta)
|
||||
}
|
||||
|
||||
/* Check to which side the minecart is to be pushed.
|
||||
Let's consider a z-x-coordinate system where the minecart is the center (0/0).
|
||||
Let's consider a z-x-coordinate system where the minecart is the center (0, 0).
|
||||
The minecart moves along the line x = -z, the perpendicular line to this is x = z.
|
||||
In order to decide to which side the minecart is to be pushed, it must be checked on what side of the perpendicular line the pushing entity is located. */
|
||||
if (
|
||||
@ -954,7 +954,7 @@ bool cMinecart::TestEntityCollision(NIBBLETYPE a_RailMeta)
|
||||
}
|
||||
|
||||
/* Check to which side the minecart is to be pushed.
|
||||
Let's consider a z-x-coordinate system where the minecart is the center (0/0).
|
||||
Let's consider a z-x-coordinate system where the minecart is the center (0, 0).
|
||||
The minecart moves along the line x = z, the perpendicular line to this is x = -z.
|
||||
In order to decide to which side the minecart is to be pushed, it must be checked on what side of the perpendicular line the pushing entity is located. */
|
||||
if (
|
||||
|
@ -29,7 +29,7 @@ public:
|
||||
enum ePayload
|
||||
{
|
||||
mpNone = 0, // Empty minecart, ridable by player or mobs
|
||||
mpChest = 1, // Minecart-with-chest, can store a grid of 3*8 items
|
||||
mpChest = 1, // Minecart-with-chest, can store a grid of 3 * 8 items
|
||||
mpFurnace = 2, // Minecart-with-furnace, can be powered
|
||||
mpTNT = 3, // Minecart-with-TNT, can be blown up with activator rail
|
||||
mpHopper = 5, // Minecart-with-hopper, can be hopper
|
||||
@ -54,8 +54,7 @@ protected:
|
||||
cMinecart(ePayload a_Payload, double a_X, double a_Y, double a_Z);
|
||||
|
||||
/** 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
|
||||
*/
|
||||
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, std::chrono::milliseconds a_Dt);
|
||||
|
||||
/** Handles powered rail physics
|
||||
|
@ -355,7 +355,7 @@ float cPlayer::GetXpPercentage()
|
||||
int currentLevel_XpBase = XpForLevel(currentLevel);
|
||||
|
||||
return static_cast<float>(m_CurrentXp - currentLevel_XpBase) /
|
||||
static_cast<float>(XpForLevel(1+currentLevel) - currentLevel_XpBase);
|
||||
static_cast<float>(XpForLevel(1 + currentLevel) - currentLevel_XpBase);
|
||||
}
|
||||
|
||||
|
||||
@ -364,7 +364,7 @@ float cPlayer::GetXpPercentage()
|
||||
|
||||
bool cPlayer::SetCurrentExperience(int a_CurrentXp)
|
||||
{
|
||||
if (!(a_CurrentXp >= 0) || (a_CurrentXp > (std::numeric_limits<int>().max() - m_LifetimeTotalXp)))
|
||||
if (!(a_CurrentXp >= 0) || (a_CurrentXp > (std::numeric_limits<int>::max() - m_LifetimeTotalXp)))
|
||||
{
|
||||
LOGWARNING("Tried to update experiece with an invalid Xp value: %d", a_CurrentXp);
|
||||
return false; // oops, they gave us a dodgey number
|
||||
@ -403,7 +403,7 @@ int cPlayer::DeltaExperience(int a_Xp_delta)
|
||||
m_LifetimeTotalXp += a_Xp_delta;
|
||||
}
|
||||
|
||||
LOGD("Player \"%s\" gained/lost %d experience, total is now: %d", GetName().c_str(), a_Xp_delta, m_CurrentXp);
|
||||
LOGD("Player \"%s\" gained / lost %d experience, total is now: %d", GetName().c_str(), a_Xp_delta, m_CurrentXp);
|
||||
|
||||
// Set experience to be updated
|
||||
m_bDirtyExperience = true;
|
||||
@ -1771,7 +1771,7 @@ bool cPlayer::LoadFromFile(const AString & a_FileName, cWorldPtr & a_World)
|
||||
m_LastBedPos.z = root.get("SpawnZ", a_World->GetSpawnZ()).asInt();
|
||||
|
||||
// Load the player stats.
|
||||
// We use the default world name (like bukkit) because stats are shared between dimensions/worlds.
|
||||
// We use the default world name (like bukkit) because stats are shared between dimensions / worlds.
|
||||
cStatSerializer StatSerializer(cRoot::Get()->GetDefaultWorld()->GetName(), GetName(), &m_Stats);
|
||||
StatSerializer.Load();
|
||||
|
||||
@ -1868,7 +1868,7 @@ bool cPlayer::SaveToDisk()
|
||||
}
|
||||
|
||||
// Save the player stats.
|
||||
// We use the default world name (like bukkit) because stats are shared between dimensions/worlds.
|
||||
// We use the default world name (like bukkit) because stats are shared between dimensions / worlds.
|
||||
cStatSerializer StatSerializer(cRoot::Get()->GetDefaultWorld()->GetName(), GetName(), &m_Stats);
|
||||
if (!StatSerializer.Save())
|
||||
{
|
||||
@ -2076,7 +2076,7 @@ void cPlayer::UpdateMovementStats(const Vector3d & a_DeltaPos)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Value >= 25) // Ignore small/slow movement
|
||||
if (Value >= 25) // Ignore small / slow movement
|
||||
{
|
||||
m_Stats.AddValue(statDistFlown, Value);
|
||||
}
|
||||
|
@ -644,7 +644,7 @@ protected:
|
||||
|
||||
virtual void Destroyed(void);
|
||||
|
||||
/** Filters out damage for creative mode/friendly fire */
|
||||
/** Filters out damage for creative mode / friendly fire */
|
||||
virtual bool DoTakeDamage(TakeDamageInfo & TDI) override;
|
||||
|
||||
/** Stops players from burning in creative mode */
|
||||
|
@ -109,7 +109,7 @@ protected:
|
||||
eKind m_ProjectileKind;
|
||||
|
||||
/** The structure for containing the entity ID and name who has created this projectile
|
||||
The ID and/or name may be nullptr (e.g. for dispensers/mobs). */
|
||||
The ID and / or name may be nullptr (e.g. for dispensers / mobs). */
|
||||
CreatorData m_CreatorData;
|
||||
|
||||
/** True if the projectile has hit the ground and is stuck there */
|
||||
|
@ -237,7 +237,7 @@ bool cCaveTunnel::RefineDefPoints(const cCaveDefPoints & a_Src, cCaveDefPoints &
|
||||
return true;
|
||||
}
|
||||
|
||||
// Smoothing: for each line segment, add points on its 1/4 lengths
|
||||
// Smoothing: for each line segment, add points on its 1 / 4 lengths
|
||||
bool res = false;
|
||||
size_t Num = a_Src.size() - 2; // this many intermediary points
|
||||
a_Dst.clear();
|
||||
@ -488,7 +488,7 @@ void cCaveTunnel::ProcessChunk(
|
||||
continue;
|
||||
}
|
||||
|
||||
// Carve out a sphere around the xyz point, m_Radius in diameter; skip 3/7 off the top and bottom:
|
||||
// Carve out a sphere around the xyz point, m_Radius in diameter; skip 3 / 7 off the top and bottom:
|
||||
int DifX = itr->m_BlockX - BlockStartX; // substitution for faster calc
|
||||
int DifY = itr->m_BlockY;
|
||||
int DifZ = itr->m_BlockZ - BlockStartZ; // substitution for faster calc
|
||||
|
@ -209,7 +209,7 @@ void cChunkGenerator::Execute(void)
|
||||
{
|
||||
if ((NumChunksGenerated > 16) && (clock() - LastReportTick > CLOCKS_PER_SEC))
|
||||
{
|
||||
LOG("Chunk generator performance: %.2f ch/s (%d ch total)",
|
||||
LOG("Chunk generator performance: %.2f ch / sec (%d ch total)",
|
||||
(double)NumChunksGenerated * CLOCKS_PER_SEC/ (clock() - GenerationStart),
|
||||
NumChunksGenerated
|
||||
);
|
||||
@ -241,7 +241,7 @@ void cChunkGenerator::Execute(void)
|
||||
// Display perf info once in a while:
|
||||
if ((NumChunksGenerated > 16) && (clock() - LastReportTick > 2 * CLOCKS_PER_SEC))
|
||||
{
|
||||
LOG("Chunk generator performance: %.2f ch/s (%d ch total)",
|
||||
LOG("Chunk generator performance: %.2f ch / sec (%d ch total)",
|
||||
(double)NumChunksGenerated * CLOCKS_PER_SEC / (clock() - GenerationStart),
|
||||
NumChunksGenerated
|
||||
);
|
||||
|
@ -195,7 +195,7 @@ void cFinishGenGlowStone::GenFinish(cChunkDesc & a_ChunkDesc)
|
||||
// The maximum size for a string of glowstone can get 3 - 5 blocks long
|
||||
int Size = 3 + m_Noise.IntNoise3DInt(ChunkX, i, ChunkZ) % 3;
|
||||
|
||||
// Generate X/Z coordinates.
|
||||
// Generate X / Z coordinates.
|
||||
int X = Size + (m_Noise.IntNoise2DInt(i, Size) % (cChunkDef::Width - Size * 2));
|
||||
int Z = Size + (m_Noise.IntNoise2DInt(X, i) % (cChunkDef::Width - Size * 2));
|
||||
|
||||
|
@ -667,7 +667,7 @@ public:
|
||||
|
||||
virtual void GenHeightMap(int a_ChunkX, int a_ChunkZ, cChunkDef::HeightMap & a_HeightMap)
|
||||
{
|
||||
// Generate the biomes for the 3*3 neighbors:
|
||||
// Generate the biomes for the 3 * 3 neighbors:
|
||||
cChunkDef::BiomeMap neighborBiomes[3][3];
|
||||
for (int z = 0; z < 3; z++) for (int x = 0; x < 3; x++)
|
||||
{
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
/*
|
||||
The integers generated may be interpreted in several ways:
|
||||
- land/see designators
|
||||
- land / sea designators
|
||||
- 0 = ocean
|
||||
- >0 = land
|
||||
- biome group
|
||||
@ -310,7 +310,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
// Copy from Cache into a_Values; take into account the even/odd offsets in a_Min:
|
||||
// Copy from Cache into a_Values; take into account the even / odd offsets in a_Min:
|
||||
for (int z = 0; z < SizeZ; ++z)
|
||||
{
|
||||
memcpy(a_Values + z * SizeX, cache + (z + (a_MinZ & 1)) * lowStepX + (a_MinX & 1), SizeX * sizeof(int));
|
||||
|
@ -680,7 +680,7 @@ void cBiomalNoise3DComposable::GenerateNoiseArrayIfNeeded(int a_ChunkX, int a_Ch
|
||||
|
||||
void cBiomalNoise3DComposable::CalcBiomeParamArrays(int a_ChunkX, int a_ChunkZ, ChunkParam & a_HeightAmp, ChunkParam & a_MidPoint)
|
||||
{
|
||||
// Generate the 3*3 chunks of biomes around this chunk:
|
||||
// Generate the 3 * 3 chunks of biomes around this chunk:
|
||||
cChunkDef::BiomeMap neighborBiomes[3 * 3];
|
||||
for (int z = 0; z < 3; z++)
|
||||
{
|
||||
|
@ -229,7 +229,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
// Copy from Cache into a_Values; take into account the even/odd offsets in a_Min:
|
||||
// Copy from Cache into a_Values; take into account the even / odd offsets in a_Min:
|
||||
for (int z = 0; z < a_SizeZ; ++z)
|
||||
{
|
||||
memcpy(a_Values + z * a_SizeX, cache + (z + (a_MinZ & 1)) * lowStepX + (a_MinX & 1), a_SizeX * sizeof(int));
|
||||
|
@ -61,7 +61,7 @@ protected:
|
||||
/** The noise used as a pseudo-random generator */
|
||||
cNoise m_Noise;
|
||||
|
||||
/** Maximum size, in X/Z blocks, of the village (radius from the origin) */
|
||||
/** Maximum size, in X / Z blocks, of the village (radius from the origin) */
|
||||
int m_MaxSize;
|
||||
|
||||
/** Borders of the vilalge - no item may reach out of this cuboid. */
|
||||
|
@ -34,7 +34,7 @@ protected:
|
||||
/** Maximum depth of the generator tree*/
|
||||
int m_MaxDepth;
|
||||
|
||||
/** Maximum size, in X/Z blocks, of the base (radius from the origin) */
|
||||
/** Maximum size, in X / Z blocks, of the structure (radius from the origin) */
|
||||
int m_MaxSize;
|
||||
|
||||
|
||||
|
@ -124,7 +124,7 @@ cStructGenRavines::cRavine::cRavine(int a_GridX, int a_GridZ, int a_OriginX, int
|
||||
|
||||
void cStructGenRavines::cRavine::GenerateBaseDefPoints(int a_BlockX, int a_BlockZ, int a_Size, cNoise & a_Noise)
|
||||
{
|
||||
// Modify the size slightly to have different-sized ravines (1/2 to 1/1 of a_Size):
|
||||
// Modify the size slightly to have different-sized ravines (1 / 2 to 1 / 1 of a_Size):
|
||||
a_Size = (512 + ((a_Noise.IntNoise3DInt(19 * a_BlockX, 11 * a_BlockZ, a_BlockX + a_BlockZ) / 17) % 512)) * a_Size / 1024;
|
||||
|
||||
// The complete offset of the ravine from its cellpoint, up to 2 * a_Size in each direction
|
||||
@ -177,7 +177,7 @@ void cStructGenRavines::cRavine::RefineDefPoints(const cRavDefPoints & a_Src, cR
|
||||
return;
|
||||
}
|
||||
|
||||
// Smoothing: for each line segment, add points on its 1/4 lengths
|
||||
// Smoothing: for each line segment, add points on its 1 / 4 lengths
|
||||
size_t Num = a_Src.size() - 2; // this many intermediary points
|
||||
a_Dst.clear();
|
||||
a_Dst.reserve(Num * 2 + 2);
|
||||
|
@ -311,7 +311,7 @@ void cStructGenOreNests::GenerateOre(int a_ChunkX, int a_ChunkZ, BLOCKTYPE a_Ore
|
||||
rnd /= cChunkDef::Width;
|
||||
int BaseY = rnd % a_MaxHeight;
|
||||
rnd /= a_MaxHeight;
|
||||
int NestSize = a_NestSize + (rnd % (a_NestSize / 4)); // The actual nest size may be up to 1/4 larger
|
||||
int NestSize = a_NestSize + (rnd % (a_NestSize / 4)); // The actual nest size may be up to 1 / 4 larger
|
||||
int Num = 0;
|
||||
while (Num < NestSize)
|
||||
{
|
||||
|
@ -61,7 +61,7 @@ protected:
|
||||
/** The noise used as a pseudo-random generator */
|
||||
cNoise m_Noise;
|
||||
|
||||
/** Maximum size, in X/Z blocks, of the structure (radius from the origin) */
|
||||
/** Maximum size, in X / Z blocks, of the structure (radius from the origin) */
|
||||
int m_MaxSize;
|
||||
|
||||
/** Borders of the structure - no item may reach out of this cuboid. */
|
||||
|
@ -31,10 +31,10 @@ protected:
|
||||
/** The noise used for generating random numbers */
|
||||
cNoise m_Noise;
|
||||
|
||||
/** Maximum depth of the generator tree*/
|
||||
/** Maximum depth of the generator tree */
|
||||
int m_MaxDepth;
|
||||
|
||||
/** Maximum size, in X/Z blocks, of the base (radius from the origin) */
|
||||
/** Maximum size, in X / Z blocks, of the structure (radius from the origin) */
|
||||
int m_MaxSize;
|
||||
|
||||
|
||||
|
@ -499,7 +499,7 @@ void GetBirchTreeImage(int a_BlockX, int a_BlockY, int a_BlockZ, cNoise & a_Nois
|
||||
PushCornerBlocks(a_BlockX, h, a_BlockZ, a_Seq, a_Noise, 0x5fffffff, a_OtherBlocks, 1, E_BLOCK_LEAVES, E_META_LEAVES_BIRCH);
|
||||
h--;
|
||||
|
||||
// Third and fourth layers - BigO2 and maybe 2*Corners:
|
||||
// Third and fourth layers - BigO2 and maybe 2 * Corners:
|
||||
for (int Row = 0; Row < 2; Row++)
|
||||
{
|
||||
PushCoordBlocks (a_BlockX, h, a_BlockZ, a_OtherBlocks, BigO2, ARRAYCOUNT(BigO2), E_BLOCK_LEAVES, E_META_LEAVES_BIRCH);
|
||||
@ -673,7 +673,7 @@ void GetTallBirchTreeImage(int a_BlockX, int a_BlockY, int a_BlockZ, cNoise & a_
|
||||
PushCornerBlocks(a_BlockX, h, a_BlockZ, a_Seq, a_Noise, 0x5fffffff, a_OtherBlocks, 1, E_BLOCK_LEAVES, E_META_LEAVES_BIRCH);
|
||||
h--;
|
||||
|
||||
// Third and fourth layers - BigO2 and maybe 2*Corners:
|
||||
// Third and fourth layers - BigO2 and maybe 2 * Corners:
|
||||
for (int Row = 0; Row < 2; Row++)
|
||||
{
|
||||
PushCoordBlocks (a_BlockX, h, a_BlockZ, a_OtherBlocks, BigO2, ARRAYCOUNT(BigO2), E_BLOCK_LEAVES, E_META_LEAVES_BIRCH);
|
||||
|
@ -61,7 +61,7 @@ protected:
|
||||
/** The noise used as a pseudo-random generator */
|
||||
cNoise m_Noise;
|
||||
|
||||
/** Maximum size, in X/Z blocks, of the village (radius from the origin) */
|
||||
/** Maximum size, in X / Z blocks, of the base (radius from the origin) */
|
||||
int m_MaxSize;
|
||||
|
||||
/** Borders of the vilalge - no item may reach out of this cuboid. */
|
||||
|
@ -34,7 +34,7 @@ protected:
|
||||
/** Maximum depth of the generator tree*/
|
||||
int m_MaxDepth;
|
||||
|
||||
/** Maximum size, in X/Z blocks, of the base (radius from the origin) */
|
||||
/** Maximum size, in X / Z blocks, of the structure (radius from the origin) */
|
||||
int m_MaxSize;
|
||||
|
||||
/** The underlying biome generator that defines whether the base is created or not */
|
||||
|
@ -162,7 +162,7 @@ protected:
|
||||
/** The noise used as a pseudo-random generator */
|
||||
cNoise m_Noise;
|
||||
|
||||
/** Maximum size, in X/Z blocks, of the village (radius from the origin) */
|
||||
/** Maximum size, in X / Z blocks, of the village (radius from the origin) */
|
||||
int m_MaxSize;
|
||||
|
||||
/** The density for this village. Used to refrain from populating all house connectors. Range [0, 100] */
|
||||
|
@ -32,7 +32,7 @@ protected:
|
||||
/** Maximum depth of the generator tree*/
|
||||
int m_MaxDepth;
|
||||
|
||||
/** Maximum size, in X/Z blocks, of the village (radius from the origin) */
|
||||
/** Maximum size, in X / Z blocks, of the village (radius from the origin) */
|
||||
int m_MaxSize;
|
||||
|
||||
/** Minimum density - percentage of allowed house connections. Range [0, 100] */
|
||||
|
@ -18,9 +18,9 @@
|
||||
|
||||
// Useful warnings from warning level 4:
|
||||
#pragma warning(3 : 4189) // Local variable is initialized but not referenced
|
||||
#pragma warning(3 : 4245) // Conversion from 'type1' to 'type2', signed/unsigned mismatch
|
||||
#pragma warning(3 : 4245) // Conversion from 'type1' to 'type2', signed / unsigned mismatch
|
||||
#pragma warning(3 : 4310) // Cast truncates constant value
|
||||
#pragma warning(3 : 4389) // Signed/unsigned mismatch
|
||||
#pragma warning(3 : 4389) // Signed / unsigned mismatch
|
||||
#pragma warning(3 : 4505) // Unreferenced local function has been removed
|
||||
#pragma warning(3 : 4701) // Potentially unitialized local variable used
|
||||
#pragma warning(3 : 4702) // Unreachable code
|
||||
|
@ -61,7 +61,7 @@ public:
|
||||
AString m_LastValue;
|
||||
|
||||
|
||||
/** Notifies the callback of the key/value stored in m_LastKey/m_LastValue, then erases them */
|
||||
/** Notifies the callback of the key / value stored in m_LastKey / m_LastValue, then erases them */
|
||||
void NotifyLast(void);
|
||||
|
||||
/** Parses one line of header data. Returns true if successful */
|
||||
|
@ -202,7 +202,7 @@ size_t cHTTPRequest::ParseRequestLine(const char * a_Data, size_t a_Size)
|
||||
m_IsValid = false;
|
||||
return AString::npos;
|
||||
}
|
||||
// Check that there's HTTP/version at the end
|
||||
// Check that there's HTTP / version at the end
|
||||
if (strncmp(m_IncomingHeaderData.c_str() + URLEnd + 1, "HTTP/1.", 7) != 0)
|
||||
{
|
||||
m_IsValid = false;
|
||||
|
@ -1,11 +1,11 @@
|
||||
// IniFile.cpp: Implementation of the CIniFile class.
|
||||
// Written by: Adam Clauss
|
||||
// Email: cabadam@houston.rr.com
|
||||
// You may use this class/code as you wish in your programs. Feel free to distribute it, and
|
||||
// You may use this class / code as you wish in your programs. Feel free to distribute it, and
|
||||
// email suggested changes to me.
|
||||
//
|
||||
// Rewritten by: Shane Hill
|
||||
// Date: 21/08/2001
|
||||
// Date: 2001-08-21
|
||||
// Email: Shane.Hill@dsto.defence.gov.au
|
||||
// Reason: Remove dependancy on MFC. Code should compile on any
|
||||
// platform.
|
||||
|
@ -1,14 +1,14 @@
|
||||
// IniFile.cpp: Implementation of the CIniFile class.
|
||||
// Written by: Adam Clauss
|
||||
// Email: cabadam@tamu.edu
|
||||
// You may use this class/code as you wish in your programs. Feel free to distribute it, and
|
||||
// You may use this class / code as you wish in your programs. Feel free to distribute it, and
|
||||
// email suggested changes to me.
|
||||
//
|
||||
// Rewritten by: Shane Hill
|
||||
// Date: 21/08/2001
|
||||
// Date: 2001-08-21
|
||||
// Email: Shane.Hill@dsto.defence.gov.au
|
||||
// Reason: Remove dependancy on MFC. Code should compile on any
|
||||
// platform. Tested on Windows/Linux/Irix
|
||||
// platform. Tested on Windows / Linux / Irix
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/*
|
||||
@ -108,7 +108,7 @@ public:
|
||||
|
||||
// Gets value of [keyname] valuename =.
|
||||
// Overloaded to return string, int, and double.
|
||||
// Returns defValue if key/value not found.
|
||||
// Returns defValue if key / value not found.
|
||||
AString GetValue (const AString & keyname, const AString & valuename, const AString & defValue = "") const;
|
||||
AString GetValue (const int keyID, const int valueID, const AString & defValue = "") const;
|
||||
double GetValueF(const AString & keyname, const AString & valuename, const double defValue = 0) const;
|
||||
@ -217,7 +217,7 @@ public:
|
||||
|
||||
|
||||
|
||||
/** Reads the list of ports from the INI file, possibly upgrading from IPv4/IPv6-specific values into new version-agnostic value.
|
||||
/** Reads the list of ports from the INI file, possibly upgrading from IPv4 / IPv6-specific values into new version-agnostic value.
|
||||
Reads the list of ports from a_PortsValueName. If that value doesn't exist or is empty, the list is combined from values
|
||||
in a_OldIPv4ValueName and a_OldIPv6ValueName; in this case the old values are removed from the INI file.
|
||||
If there is none of the three values or they are all empty, the default is used and stored in the Ports value. */
|
||||
|
@ -64,7 +64,7 @@ public:
|
||||
}
|
||||
default:
|
||||
{
|
||||
// Light a fire next to/on top of the block if air:
|
||||
// Light a fire next to / on top of the block if air:
|
||||
AddFaceDirection(a_BlockX, a_BlockY, a_BlockZ, a_BlockFace);
|
||||
if ((a_BlockY < 0) || (a_BlockY >= cChunkDef::Height))
|
||||
{
|
||||
|
@ -71,7 +71,7 @@ public:
|
||||
cBlockInfo::FullyOccupiesVoxel(a_CBBlockType)
|
||||
)
|
||||
{
|
||||
// Can't place lilypad on air/in another block!
|
||||
// Can't place lilypad on air / in another block!
|
||||
return true;
|
||||
}
|
||||
m_HasHitFluid = true;
|
||||
|
@ -140,7 +140,7 @@ public:
|
||||
/** Update a circular region around the specified player. */
|
||||
void UpdateRadius(cPlayer & a_Player, unsigned int a_Radius);
|
||||
|
||||
/** Send next update packet to the specified player and remove invalid decorators/clients. */
|
||||
/** Send next update packet to the specified player and remove invalid decorators / clients. */
|
||||
void UpdateClient(cPlayer * a_Player);
|
||||
|
||||
// tolua_begin
|
||||
|
@ -19,8 +19,8 @@ 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
|
||||
// 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
|
||||
const int ratio = 319; // This should be 256 as we are only supposed to take account from chunks that are in 17 x 17 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))
|
||||
{
|
||||
|
@ -224,7 +224,7 @@ protected:
|
||||
Calls ResetPathFinding and sets m_IsFollowingPath to false */
|
||||
void StopMovingToPosition();
|
||||
|
||||
/** Sets the body yaw and head yaw/pitch based on next/ultimate destinations */
|
||||
/** Sets the body yaw and head yaw / pitch based on next / ultimate destinations */
|
||||
void SetPitchAndYawFromDestination(void);
|
||||
|
||||
virtual void HandleFalling(void);
|
||||
|
@ -12,7 +12,7 @@ Put this in your .cpp:
|
||||
*/
|
||||
|
||||
#ifdef COMPILING_PATHFIND_DEBUGGER
|
||||
/* Note: the COMPILING_PATHFIND_DEBUGGER flag is used by Native/WiseOldMan95 to debug
|
||||
/* Note: the COMPILING_PATHFIND_DEBUGGER flag is used by Native / WiseOldMan95 to debug
|
||||
this class outside of MCServer. This preprocessor flag is never set when compiling MCServer. */
|
||||
#include "PathFinderIrrlicht_Head.h"
|
||||
#endif
|
||||
|
@ -633,10 +633,10 @@ NOISE_DATATYPE cNoise::CubicNoise3D(NOISE_DATATYPE a_X, NOISE_DATATYPE a_Y, NOIS
|
||||
};
|
||||
|
||||
const NOISE_DATATYPE FracX = (a_X) - BaseX;
|
||||
const NOISE_DATATYPE x1interp1 = CubicInterpolate( points1[0][0], points1[0][1], points1[0][2], points1[0][3], FracX);
|
||||
const NOISE_DATATYPE x1interp2 = CubicInterpolate( points1[1][0], points1[1][1], points1[1][2], points1[1][3], FracX);
|
||||
const NOISE_DATATYPE x1interp3 = CubicInterpolate( points1[2][0], points1[2][1], points1[2][2], points1[2][3], FracX);
|
||||
const NOISE_DATATYPE x1interp4 = CubicInterpolate( points1[3][0], points1[3][1], points1[3][2], points1[3][3], FracX);
|
||||
const NOISE_DATATYPE x1interp1 = CubicInterpolate(points1[0][0], points1[0][1], points1[0][2], points1[0][3], FracX);
|
||||
const NOISE_DATATYPE x1interp2 = CubicInterpolate(points1[1][0], points1[1][1], points1[1][2], points1[1][3], FracX);
|
||||
const NOISE_DATATYPE x1interp3 = CubicInterpolate(points1[2][0], points1[2][1], points1[2][2], points1[2][3], FracX);
|
||||
const NOISE_DATATYPE x1interp4 = CubicInterpolate(points1[3][0], points1[3][1], points1[3][2], points1[3][3], FracX);
|
||||
|
||||
const NOISE_DATATYPE points2[4][4] =
|
||||
{
|
||||
@ -646,45 +646,45 @@ NOISE_DATATYPE cNoise::CubicNoise3D(NOISE_DATATYPE a_X, NOISE_DATATYPE a_Y, NOIS
|
||||
{ IntNoise3D(BaseX - 1, BaseY + 2, BaseZ), IntNoise3D(BaseX, BaseY + 2, BaseZ), IntNoise3D(BaseX + 1, BaseY + 2, BaseZ), IntNoise3D(BaseX + 2, BaseY + 2, BaseZ), },
|
||||
};
|
||||
|
||||
const NOISE_DATATYPE x2interp1 = CubicInterpolate( points2[0][0], points2[0][1], points2[0][2], points2[0][3], FracX);
|
||||
const NOISE_DATATYPE x2interp2 = CubicInterpolate( points2[1][0], points2[1][1], points2[1][2], points2[1][3], FracX);
|
||||
const NOISE_DATATYPE x2interp3 = CubicInterpolate( points2[2][0], points2[2][1], points2[2][2], points2[2][3], FracX);
|
||||
const NOISE_DATATYPE x2interp4 = CubicInterpolate( points2[3][0], points2[3][1], points2[3][2], points2[3][3], FracX);
|
||||
const NOISE_DATATYPE x2interp1 = CubicInterpolate(points2[0][0], points2[0][1], points2[0][2], points2[0][3], FracX);
|
||||
const NOISE_DATATYPE x2interp2 = CubicInterpolate(points2[1][0], points2[1][1], points2[1][2], points2[1][3], FracX);
|
||||
const NOISE_DATATYPE x2interp3 = CubicInterpolate(points2[2][0], points2[2][1], points2[2][2], points2[2][3], FracX);
|
||||
const NOISE_DATATYPE x2interp4 = CubicInterpolate(points2[3][0], points2[3][1], points2[3][2], points2[3][3], FracX);
|
||||
|
||||
const NOISE_DATATYPE points3[4][4] =
|
||||
{
|
||||
{ IntNoise3D( BaseX-1, BaseY-1, BaseZ+1), IntNoise3D( BaseX, BaseY-1, BaseZ+1), IntNoise3D( BaseX+1, BaseY-1, BaseZ+1), IntNoise3D( BaseX+2, BaseY-1, BaseZ + 1), },
|
||||
{ IntNoise3D( BaseX-1, BaseY, BaseZ+1), IntNoise3D( BaseX, BaseY, BaseZ+1), IntNoise3D( BaseX+1, BaseY, BaseZ+1), IntNoise3D( BaseX+2, BaseY, BaseZ + 1), },
|
||||
{ IntNoise3D( BaseX-1, BaseY+1, BaseZ+1), IntNoise3D( BaseX, BaseY+1, BaseZ+1), IntNoise3D( BaseX+1, BaseY+1, BaseZ+1), IntNoise3D( BaseX+2, BaseY+1, BaseZ + 1), },
|
||||
{ IntNoise3D( BaseX-1, BaseY+2, BaseZ+1), IntNoise3D( BaseX, BaseY+2, BaseZ+1), IntNoise3D( BaseX+1, BaseY+2, BaseZ+1), IntNoise3D( BaseX+2, BaseY+2, BaseZ + 1), },
|
||||
{ IntNoise3D(BaseX - 1, BaseY - 1, BaseZ + 1), IntNoise3D(BaseX, BaseY - 1, BaseZ + 1), IntNoise3D(BaseX + 1, BaseY - 1, BaseZ + 1), IntNoise3D(BaseX + 2, BaseY - 1, BaseZ + 1), },
|
||||
{ IntNoise3D(BaseX - 1, BaseY, BaseZ + 1), IntNoise3D(BaseX, BaseY, BaseZ + 1), IntNoise3D(BaseX + 1, BaseY, BaseZ + 1), IntNoise3D(BaseX + 2, BaseY, BaseZ + 1), },
|
||||
{ IntNoise3D(BaseX - 1, BaseY + 1, BaseZ + 1), IntNoise3D(BaseX, BaseY + 1, BaseZ + 1), IntNoise3D(BaseX + 1, BaseY + 1, BaseZ + 1), IntNoise3D(BaseX + 2, BaseY + 1, BaseZ + 1), },
|
||||
{ IntNoise3D(BaseX - 1, BaseY + 2, BaseZ + 1), IntNoise3D(BaseX, BaseY + 2, BaseZ + 1), IntNoise3D(BaseX + 1, BaseY + 2, BaseZ + 1), IntNoise3D(BaseX + 2, BaseY + 2, BaseZ + 1), },
|
||||
};
|
||||
|
||||
const NOISE_DATATYPE x3interp1 = CubicInterpolate( points3[0][0], points3[0][1], points3[0][2], points3[0][3], FracX);
|
||||
const NOISE_DATATYPE x3interp2 = CubicInterpolate( points3[1][0], points3[1][1], points3[1][2], points3[1][3], FracX);
|
||||
const NOISE_DATATYPE x3interp3 = CubicInterpolate( points3[2][0], points3[2][1], points3[2][2], points3[2][3], FracX);
|
||||
const NOISE_DATATYPE x3interp4 = CubicInterpolate( points3[3][0], points3[3][1], points3[3][2], points3[3][3], FracX);
|
||||
const NOISE_DATATYPE x3interp1 = CubicInterpolate(points3[0][0], points3[0][1], points3[0][2], points3[0][3], FracX);
|
||||
const NOISE_DATATYPE x3interp2 = CubicInterpolate(points3[1][0], points3[1][1], points3[1][2], points3[1][3], FracX);
|
||||
const NOISE_DATATYPE x3interp3 = CubicInterpolate(points3[2][0], points3[2][1], points3[2][2], points3[2][3], FracX);
|
||||
const NOISE_DATATYPE x3interp4 = CubicInterpolate(points3[3][0], points3[3][1], points3[3][2], points3[3][3], FracX);
|
||||
|
||||
const NOISE_DATATYPE points4[4][4] =
|
||||
{
|
||||
{ IntNoise3D( BaseX-1, BaseY-1, BaseZ+2), IntNoise3D( BaseX, BaseY-1, BaseZ+2), IntNoise3D( BaseX+1, BaseY-1, BaseZ+2), IntNoise3D( BaseX+2, BaseY-1, BaseZ+2), },
|
||||
{ IntNoise3D( BaseX-1, BaseY, BaseZ+2), IntNoise3D( BaseX, BaseY, BaseZ+2), IntNoise3D( BaseX+1, BaseY, BaseZ+2), IntNoise3D( BaseX+2, BaseY, BaseZ+2), },
|
||||
{ IntNoise3D( BaseX-1, BaseY+1, BaseZ+2), IntNoise3D( BaseX, BaseY+1, BaseZ+2), IntNoise3D( BaseX+1, BaseY+1, BaseZ+2), IntNoise3D( BaseX+2, BaseY+1, BaseZ+2), },
|
||||
{ IntNoise3D( BaseX-1, BaseY+2, BaseZ+2), IntNoise3D( BaseX, BaseY+2, BaseZ+2), IntNoise3D( BaseX+1, BaseY+2, BaseZ+2), IntNoise3D( BaseX+2, BaseY+2, BaseZ+2), },
|
||||
{ IntNoise3D(BaseX - 1, BaseY - 1, BaseZ + 2), IntNoise3D(BaseX, BaseY - 1, BaseZ + 2), IntNoise3D(BaseX + 1, BaseY - 1, BaseZ + 2), IntNoise3D(BaseX + 2, BaseY - 1, BaseZ + 2), },
|
||||
{ IntNoise3D(BaseX - 1, BaseY, BaseZ + 2), IntNoise3D(BaseX, BaseY, BaseZ + 2), IntNoise3D(BaseX + 1, BaseY, BaseZ + 2), IntNoise3D(BaseX + 2, BaseY, BaseZ + 2), },
|
||||
{ IntNoise3D(BaseX - 1, BaseY + 1, BaseZ + 2), IntNoise3D(BaseX, BaseY + 1, BaseZ + 2), IntNoise3D(BaseX + 1, BaseY + 1, BaseZ + 2), IntNoise3D(BaseX + 2, BaseY + 1, BaseZ + 2), },
|
||||
{ IntNoise3D(BaseX - 1, BaseY + 2, BaseZ + 2), IntNoise3D(BaseX, BaseY + 2, BaseZ + 2), IntNoise3D(BaseX + 1, BaseY + 2, BaseZ + 2), IntNoise3D(BaseX + 2, BaseY + 2, BaseZ + 2), },
|
||||
};
|
||||
|
||||
const NOISE_DATATYPE x4interp1 = CubicInterpolate( points4[0][0], points4[0][1], points4[0][2], points4[0][3], FracX);
|
||||
const NOISE_DATATYPE x4interp2 = CubicInterpolate( points4[1][0], points4[1][1], points4[1][2], points4[1][3], FracX);
|
||||
const NOISE_DATATYPE x4interp3 = CubicInterpolate( points4[2][0], points4[2][1], points4[2][2], points4[2][3], FracX);
|
||||
const NOISE_DATATYPE x4interp4 = CubicInterpolate( points4[3][0], points4[3][1], points4[3][2], points4[3][3], FracX);
|
||||
const NOISE_DATATYPE x4interp1 = CubicInterpolate(points4[0][0], points4[0][1], points4[0][2], points4[0][3], FracX);
|
||||
const NOISE_DATATYPE x4interp2 = CubicInterpolate(points4[1][0], points4[1][1], points4[1][2], points4[1][3], FracX);
|
||||
const NOISE_DATATYPE x4interp3 = CubicInterpolate(points4[2][0], points4[2][1], points4[2][2], points4[2][3], FracX);
|
||||
const NOISE_DATATYPE x4interp4 = CubicInterpolate(points4[3][0], points4[3][1], points4[3][2], points4[3][3], FracX);
|
||||
|
||||
const NOISE_DATATYPE FracY = (a_Y) - BaseY;
|
||||
const NOISE_DATATYPE yinterp1 = CubicInterpolate( x1interp1, x1interp2, x1interp3, x1interp4, FracY);
|
||||
const NOISE_DATATYPE yinterp2 = CubicInterpolate( x2interp1, x2interp2, x2interp3, x2interp4, FracY);
|
||||
const NOISE_DATATYPE yinterp3 = CubicInterpolate( x3interp1, x3interp2, x3interp3, x3interp4, FracY);
|
||||
const NOISE_DATATYPE yinterp4 = CubicInterpolate( x4interp1, x4interp2, x4interp3, x4interp4, FracY);
|
||||
const NOISE_DATATYPE yinterp1 = CubicInterpolate(x1interp1, x1interp2, x1interp3, x1interp4, FracY);
|
||||
const NOISE_DATATYPE yinterp2 = CubicInterpolate(x2interp1, x2interp2, x2interp3, x2interp4, FracY);
|
||||
const NOISE_DATATYPE yinterp3 = CubicInterpolate(x3interp1, x3interp2, x3interp3, x3interp4, FracY);
|
||||
const NOISE_DATATYPE yinterp4 = CubicInterpolate(x4interp1, x4interp2, x4interp3, x4interp4, FracY);
|
||||
|
||||
const NOISE_DATATYPE FracZ = (a_Z) - BaseZ;
|
||||
return CubicInterpolate( yinterp1, yinterp2, yinterp3, yinterp4, FracZ);
|
||||
return CubicInterpolate(yinterp1, yinterp2, yinterp3, yinterp4, FracZ);
|
||||
}
|
||||
|
||||
|
||||
|
@ -13,7 +13,7 @@ public:
|
||||
void Lock(void);
|
||||
void Unlock(void);
|
||||
|
||||
// IsLocked/IsLockedByCurrentThread are only used in ASSERT statements, but because of the changes with ASSERT they must always be defined
|
||||
// IsLocked / IsLockedByCurrentThread are only used in ASSERT statements, but because of the changes with ASSERT they must always be defined
|
||||
// The fake versions (in Release) will not effect the program in any way
|
||||
#ifdef _DEBUG
|
||||
cCriticalSection(void);
|
||||
|
@ -62,7 +62,7 @@ public:
|
||||
{
|
||||
fmRead, // Read-only. If the file doesn't exist, object will not be valid
|
||||
fmWrite, // Write-only. If the file already exists, it will be overwritten
|
||||
fmReadWrite, // Read/write. If the file already exists, it will be left intact; writing will overwrite the data from the beginning
|
||||
fmReadWrite, // Read / write. If the file already exists, it will be left intact; writing will overwrite the data from the beginning
|
||||
fmAppend // Write-only. If the file already exists cursor will be moved to the end of the file
|
||||
} ;
|
||||
|
||||
|
@ -162,7 +162,7 @@ public:
|
||||
/** Returns the local port to which the underlying socket is bound. */
|
||||
virtual UInt16 GetPort(void) const = 0;
|
||||
|
||||
/** Sends the specified payload in a single UDP datagram to the specified host+port combination.
|
||||
/** Sends the specified payload in a single UDP datagram to the specified host + port combination.
|
||||
Note that in order to send to a broadcast address, you need to call EnableBroadcasts() first. */
|
||||
virtual bool Send(const AString & a_Payload, const AString & a_Host, UInt16 a_Port) = 0;
|
||||
|
||||
|
@ -659,7 +659,7 @@ void cMojangAPI::QueryNamesToUUIDs(AStringVector & a_NamesToQuery)
|
||||
a_NamesToQuery.erase(a_NamesToQuery.begin(), itr);
|
||||
Json::FastWriter Writer;
|
||||
AString RequestBody = Writer.write(root);
|
||||
|
||||
|
||||
// Create the HTTP request:
|
||||
AString Request;
|
||||
Request += "POST " + m_NameToUUIDAddress + " HTTP/1.0\r\n"; // We need to use HTTP 1.0 because we don't handle Chunked transfer encoding
|
||||
@ -667,7 +667,7 @@ void cMojangAPI::QueryNamesToUUIDs(AStringVector & a_NamesToQuery)
|
||||
Request += "User-Agent: MCServer\r\n";
|
||||
Request += "Connection: close\r\n";
|
||||
Request += "Content-Type: application/json\r\n";
|
||||
Request += Printf("Content-Length: %u\r\n", (unsigned)RequestBody.length());
|
||||
Request += Printf("Content-Length: %u\r\n", static_cast<unsigned>(RequestBody.length()));
|
||||
Request += "\r\n";
|
||||
Request += RequestBody;
|
||||
|
||||
|
@ -492,7 +492,7 @@ void cProtocol172::SendEntityVelocity(const cEntity & a_Entity)
|
||||
|
||||
cPacketizer Pkt(*this, 0x12); // Entity Velocity packet
|
||||
Pkt.WriteBEUInt32(a_Entity.GetUniqueID());
|
||||
// 400 = 8000 / 20 ... Conversion from our speed in m/s to 8000 m/tick
|
||||
// 400 = 8000 / 20 ... Conversion from our speed in m / s to 8000 m / tick
|
||||
Pkt.WriteBEInt16(static_cast<short>(a_Entity.GetSpeedX() * 400));
|
||||
Pkt.WriteBEInt16(static_cast<short>(a_Entity.GetSpeedY() * 400));
|
||||
Pkt.WriteBEInt16(static_cast<short>(a_Entity.GetSpeedZ() * 400));
|
||||
@ -2514,7 +2514,7 @@ void cProtocol172::ParseItemMetadata(cItem & a_Item, const AString & a_Metadata)
|
||||
|
||||
for (int loretag = NBT.GetFirstChild(displaytag); loretag >= 0; loretag = NBT.GetNextSibling(loretag)) // Loop through array of strings
|
||||
{
|
||||
AppendPrintf(Lore, "%s`", NBT.GetString(loretag).c_str()); // Append the lore with a grave accent/backtick, used internally by MCS to display a new line in the client; don't forget to c_str ;)
|
||||
AppendPrintf(Lore, "%s`", NBT.GetString(loretag).c_str()); // Append the lore with a grave accent / backtick, used internally by MCS to display a new line in the client; don't forget to c_str ;)
|
||||
}
|
||||
|
||||
a_Item.m_Lore = Lore;
|
||||
|
@ -479,7 +479,7 @@ void cProtocol180::SendEntityVelocity(const cEntity & a_Entity)
|
||||
|
||||
cPacketizer Pkt(*this, 0x12); // Entity Velocity packet
|
||||
Pkt.WriteVarInt32(a_Entity.GetUniqueID());
|
||||
// 400 = 8000 / 20 ... Conversion from our speed in m/s to 8000 m/tick
|
||||
// 400 = 8000 / 20 ... Conversion from our speed in m / s to 8000 m / tick
|
||||
Pkt.WriteBEInt16((short)(a_Entity.GetSpeedX() * 400));
|
||||
Pkt.WriteBEInt16((short)(a_Entity.GetSpeedY() * 400));
|
||||
Pkt.WriteBEInt16((short)(a_Entity.GetSpeedZ() * 400));
|
||||
@ -2754,7 +2754,7 @@ void cProtocol180::ParseItemMetadata(cItem & a_Item, const AString & a_Metadata)
|
||||
|
||||
for (int loretag = NBT.GetFirstChild(displaytag); loretag >= 0; loretag = NBT.GetNextSibling(loretag)) // Loop through array of strings
|
||||
{
|
||||
AppendPrintf(Lore, "%s`", NBT.GetString(loretag).c_str()); // Append the lore with a grave accent/backtick, used internally by MCS to display a new line in the client; don't forget to c_str ;)
|
||||
AppendPrintf(Lore, "%s`", NBT.GetString(loretag).c_str()); // Append the lore with a grave accent / backtick, used internally by MCS to display a new line in the client; don't forget to c_str ;)
|
||||
}
|
||||
|
||||
a_Item.m_Lore = Lore;
|
||||
|
@ -2153,7 +2153,7 @@ void cRankManager::ClearPlayerRanks(void)
|
||||
}
|
||||
catch (SQLite::Exception & ex)
|
||||
{
|
||||
LOGWARNING("%s: Failed to remove/clear all players: %s", __FUNCTION__, ex.what());
|
||||
LOGWARNING("%s: Failed to remove / clear all players: %s", __FUNCTION__, ex.what());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -47,7 +47,7 @@ protected:
|
||||
/** Checks if there are enough neighbors to create a source at the coords specified; turns into source and returns true if so. */
|
||||
bool CheckNeighborsForSource(cChunk * a_Chunk, int a_RelX, int a_RelY, int a_RelZ);
|
||||
|
||||
/** Checks if the specified block should harden (Water/Lava interaction) and if so, converts it to a suitable block.
|
||||
/** Checks if the specified block should harden (Water / Lava interaction) and if so, converts it to a suitable block.
|
||||
Returns whether the block was changed or not. */
|
||||
bool HardenBlock(cChunk * a_Chunk, int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta);
|
||||
|
||||
|
@ -366,7 +366,7 @@ void cIncrementalRedstoneSimulator::HandleRedstoneTorch(int a_RelBlockX, int a_R
|
||||
if (i + 1 < ARRAYCOUNT(gCrossCoords)) // Sides of torch, not top (top is last)
|
||||
{
|
||||
if (
|
||||
IsMechanism(Type) && // Is it a mechanism? Not block/other torch etc.
|
||||
IsMechanism(Type) && // Is it a mechanism? Not block / other torch etc.
|
||||
(!Vector3i(a_RelBlockX + gCrossCoords[i].x, a_RelBlockY + gCrossCoords[i].y, a_RelBlockZ + gCrossCoords[i].z).Equals(Vector3i(X, Y, Z))) // CAN'T power block is that it is on
|
||||
)
|
||||
{
|
||||
@ -1600,7 +1600,7 @@ bool cIncrementalRedstoneSimulator::IsRepeaterLocked(int a_RelBlockX, int a_RelB
|
||||
if ((OtherRepeaterDir & 0x03) == 0x3)
|
||||
{
|
||||
return true;
|
||||
} // If so, I am latched/locked
|
||||
} // If so, I am latched / locked
|
||||
}
|
||||
|
||||
// Check if western(left) neighbor is a powered on repeater who is facing us
|
||||
@ -1612,7 +1612,7 @@ bool cIncrementalRedstoneSimulator::IsRepeaterLocked(int a_RelBlockX, int a_RelB
|
||||
if ((OtherRepeaterDir & 0x03) == 0x1)
|
||||
{
|
||||
return true;
|
||||
} // If so, I am latched/locked
|
||||
} // If so, I am latched / locked
|
||||
}
|
||||
|
||||
break;
|
||||
@ -1634,7 +1634,7 @@ bool cIncrementalRedstoneSimulator::IsRepeaterLocked(int a_RelBlockX, int a_RelB
|
||||
if ((OtherRepeaterDir & 0x30) == 0x00)
|
||||
{
|
||||
return true;
|
||||
} // If so, am latched/locked
|
||||
} // If so, I am latched / locked
|
||||
}
|
||||
|
||||
// Check if northern(up) neighbor is a powered on repeater who is facing us
|
||||
@ -1646,7 +1646,7 @@ bool cIncrementalRedstoneSimulator::IsRepeaterLocked(int a_RelBlockX, int a_RelB
|
||||
if ((OtherRepeaterDir & 0x03) == 0x02)
|
||||
{
|
||||
return true;
|
||||
} // If so, I am latched/locked
|
||||
} // If so, I am latched / locked
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
// DropSpenserWindow.cpp
|
||||
|
||||
// Representing the UI window for the dropper/dispenser block
|
||||
// Representing the UI window for the dropper / dispenser block
|
||||
|
||||
#include "Globals.h"
|
||||
#include "DropSpenserWindow.h"
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
// DropSpenserWindow.h
|
||||
|
||||
// Representing the UI window for the dropper/dispenser block
|
||||
// Representing the UI window for the dropper / dispenser block
|
||||
|
||||
|
||||
|
||||
|
@ -41,7 +41,7 @@ void cFurnaceWindow::DistributeStack(cItem & a_ItemStack, int a_Slot, cPlayer &
|
||||
}
|
||||
else
|
||||
{
|
||||
// Furnace Input/Fuel Slot
|
||||
// Furnace Input / Fuel Slot
|
||||
AreasInOrder.push_back(m_SlotAreas[1]); /* Inventory */
|
||||
AreasInOrder.push_back(m_SlotAreas[2]); /* Hotbar */
|
||||
super::DistributeStackToAreas(a_ItemStack, a_Player, AreasInOrder, a_ShouldApply, false);
|
||||
|
@ -306,7 +306,7 @@ public:
|
||||
void UpdateResult(cPlayer & a_Player);
|
||||
|
||||
protected:
|
||||
/** The maximum cost of repairing/renaming in the anvil. */
|
||||
/** The maximum cost of repairing / renaming in the anvil. */
|
||||
int m_MaximumCost;
|
||||
|
||||
/** The stack size of the second item where was used for repair */
|
||||
|
@ -59,7 +59,7 @@ protected:
|
||||
cNoise m_Noise2;
|
||||
cNoise m_Noise3;
|
||||
|
||||
/** Size of the Voronoi cells (avg X/Y distance between the seeds). Expected to be at least 2. */
|
||||
/** Size of the Voronoi cells (avg X / Y distance between the seeds). Expected to be at least 2. */
|
||||
int m_CellSize;
|
||||
|
||||
/** The amount that the cell seeds may be offset from the grid.
|
||||
|
@ -176,7 +176,7 @@ protected:
|
||||
{
|
||||
float PercentDone = static_cast<float>(m_NumPrepared * 100) / m_MaxIdx;
|
||||
float ChunkSpeed = static_cast<float>((m_NumPrepared - m_LastReportChunkCount) * 1000) / std::chrono::duration_cast<std::chrono::milliseconds>(Now - m_LastReportTime).count();
|
||||
LOG("Preparing spawn (%s): %.02f%% (%d/%d; %.02f chunks/s)",
|
||||
LOG("Preparing spawn (%s): %.02f%% (%d/%d; %.02f chunks / sec)",
|
||||
m_World.GetName().c_str(), PercentDone, m_NumPrepared, m_MaxIdx, ChunkSpeed
|
||||
);
|
||||
m_LastReportTime = Now;
|
||||
@ -767,7 +767,7 @@ eWeather cWorld::ChooseNewWeather()
|
||||
|
||||
case eWeather_Rain:
|
||||
{
|
||||
// 1/8 chance of turning into a thunderstorm
|
||||
// 1 / 8 chance of turning into a thunderstorm
|
||||
return ((m_TickRand.randInt() % 256) < 32) ? eWeather_ThunderStorm : eWeather_Sunny;
|
||||
}
|
||||
}
|
||||
|
@ -152,10 +152,10 @@ public:
|
||||
|
||||
int GetTicksUntilWeatherChange(void) const { return m_WeatherInterval; }
|
||||
|
||||
/** Is the daylight cyclus enabled? */
|
||||
/** Is the daylight cycle enabled? */
|
||||
virtual bool IsDaylightCycleEnabled(void) const { return m_IsDaylightCycleEnabled; }
|
||||
|
||||
/** Sets the daylight cyclus to true/false. */
|
||||
/** Sets the daylight cycle to true / false. */
|
||||
virtual void SetDaylightCycleEnabled(bool a_IsDaylightCycleEnabled)
|
||||
{
|
||||
m_IsDaylightCycleEnabled = a_IsDaylightCycleEnabled;
|
||||
@ -1067,7 +1067,7 @@ private:
|
||||
/** Handles the weather in each tick */
|
||||
void TickWeather(float a_Dt);
|
||||
|
||||
/** Handles the mob spawning/moving/destroying each tick */
|
||||
/** Handles the mob spawning / moving / destroying each tick */
|
||||
void TickMobs(std::chrono::milliseconds a_Dt);
|
||||
|
||||
/** Executes all tasks queued onto the tick thread */
|
||||
|
@ -164,7 +164,7 @@ public:
|
||||
/** Returns the direct child tag of the specified name, or -1 if no such tag. */
|
||||
int FindChildByName(int a_Tag, const char * a_Name, size_t a_NameLength = 0) const;
|
||||
|
||||
/** Returns the child tag of the specified path (Name1/Name2/Name3...), or -1 if no such tag. */
|
||||
/** Returns the child tag of the specified path (Name1 / Name2 / Name3...), or -1 if no such tag. */
|
||||
int FindTagByPath(int a_Tag, const AString & a_Path) const;
|
||||
|
||||
eTagType GetType(int a_Tag) const { return m_Tags[(size_t)a_Tag].m_Type; }
|
||||
|
@ -19,9 +19,9 @@ cMapSerializer::cMapSerializer(const AString& a_WorldName, cMap * a_Map)
|
||||
: m_Map(a_Map)
|
||||
{
|
||||
AString DataPath;
|
||||
Printf(DataPath, "%s/data", a_WorldName.c_str());
|
||||
Printf(DataPath, "%s%cdata", a_WorldName.c_str(), cFile::PathSeparator);
|
||||
|
||||
Printf(m_Path, "%s/map_%i.dat", DataPath.c_str(), a_Map->GetID());
|
||||
Printf(m_Path, "%s%cmap_%i.dat", DataPath.c_str(), cFile::PathSeparator, a_Map->GetID());
|
||||
|
||||
cFile::CreateFolder(FILE_IO_PREFIX + DataPath);
|
||||
}
|
||||
@ -203,9 +203,9 @@ bool cMapSerializer::LoadMapFromNBT(const cParsedNBT & a_NBT)
|
||||
cIDCountSerializer::cIDCountSerializer(const AString & a_WorldName) : m_MapCount(0)
|
||||
{
|
||||
AString DataPath;
|
||||
Printf(DataPath, "%s/data", a_WorldName.c_str());
|
||||
Printf(DataPath, "%s%cdata", a_WorldName.c_str(), cFile::PathSeparator);
|
||||
|
||||
Printf(m_Path, "%s/idcounts.dat", DataPath.c_str());
|
||||
Printf(m_Path, "%s%cidcounts.dat", DataPath.c_str(), cFile::PathSeparator);
|
||||
|
||||
cFile::CreateFolder(FILE_IO_PREFIX + DataPath);
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ cScoreboardSerializer::cScoreboardSerializer(const AString & a_WorldName, cScore
|
||||
: m_ScoreBoard(a_ScoreBoard)
|
||||
{
|
||||
AString DataPath;
|
||||
Printf(DataPath, "%s/data", a_WorldName.c_str());
|
||||
Printf(DataPath, "%s%cdata", a_WorldName.c_str(), cFile::PathSeparator);
|
||||
|
||||
m_Path = DataPath + "/scoreboard.dat";
|
||||
|
||||
|
@ -18,7 +18,7 @@ cStatSerializer::cStatSerializer(const AString & a_WorldName, const AString & a_
|
||||
// inside the folder of the default world.
|
||||
|
||||
AString StatsPath;
|
||||
Printf(StatsPath, "%s/stats", a_WorldName.c_str());
|
||||
Printf(StatsPath, "%s%cstats", a_WorldName.c_str(), cFile::PathSeparator);
|
||||
|
||||
m_Path = StatsPath + "/" + a_PlayerName + ".json";
|
||||
|
||||
|
@ -95,7 +95,7 @@ cWSSAnvil::cWSSAnvil(cWorld * a_World, int a_CompressionFactor) :
|
||||
{
|
||||
// Create a level.dat file for mapping tools, if it doesn't already exist:
|
||||
AString fnam;
|
||||
Printf(fnam, "%s/level.dat", a_World->GetName().c_str());
|
||||
Printf(fnam, "%s%clevel.dat", a_World->GetName().c_str(), cFile::PathSeparator);
|
||||
if (!cFile::Exists(fnam))
|
||||
{
|
||||
cFastNBTWriter Writer;
|
||||
@ -251,7 +251,7 @@ cWSSAnvil::cMCAFile * cWSSAnvil::LoadMCAFile(const cChunkCoords & a_Chunk)
|
||||
|
||||
// Load it anew:
|
||||
AString FileName;
|
||||
Printf(FileName, "%s/region", m_World->GetName().c_str());
|
||||
Printf(FileName, "%s%cregion", m_World->GetName().c_str(), cFile::PathSeparator);
|
||||
cFile::CreateFolder(FILE_IO_PREFIX + FileName);
|
||||
AppendPrintf(FileName, "/r.%d.%d.mca", RegionX, RegionZ);
|
||||
cMCAFile * f = new cMCAFile(FileName, RegionX, RegionZ);
|
||||
@ -323,7 +323,7 @@ bool cWSSAnvil::SaveChunkToData(const cChunkCoords & a_Chunk, AString & a_Data)
|
||||
|
||||
bool cWSSAnvil::LoadChunkFromNBT(const cChunkCoords & a_Chunk, const cParsedNBT & a_NBT)
|
||||
{
|
||||
// The data arrays, in MCA-native y/z/x ordering (will be reordered for the final chunk data)
|
||||
// The data arrays, in MCA-native y / z / x ordering (will be reordered for the final chunk data)
|
||||
cChunkDef::BlockTypes BlockTypes;
|
||||
cChunkDef::BlockNibbles MetaData;
|
||||
cChunkDef::BlockNibbles BlockLight;
|
||||
@ -879,7 +879,7 @@ cBlockEntity * cWSSAnvil::LoadBeaconFromNBT(const cParsedNBT & a_NBT, int a_TagI
|
||||
Beacon->SetSecondaryEffect((cEntityEffect::eType)a_NBT.GetInt(CurrentLine));
|
||||
}
|
||||
|
||||
// We are better than mojang, we load/save the beacon inventory!
|
||||
// We are better than mojang, we load / save the beacon inventory!
|
||||
int Items = a_NBT.FindChildByName(a_TagIdx, "Items");
|
||||
if ((Items >= 0) && (a_NBT.GetType(Items) == TAG_List))
|
||||
{
|
||||
|
@ -168,9 +168,9 @@ public:
|
||||
|
||||
|
||||
protected:
|
||||
// Parser callback enable/disable methods:
|
||||
// Parser callback enable / disable methods:
|
||||
|
||||
// @cmember Enable/Disable the start element handler
|
||||
// @cmember Enable / Disable the start element handler
|
||||
|
||||
void EnableStartElementHandler (bool fEnable = true)
|
||||
{
|
||||
@ -178,7 +178,7 @@ protected:
|
||||
XML_SetStartElementHandler (m_p, fEnable ? StartElementHandler : nullptr);
|
||||
}
|
||||
|
||||
// @cmember Enable/Disable the end element handler
|
||||
// @cmember Enable / Disable the end element handler
|
||||
|
||||
void EnableEndElementHandler (bool fEnable = true)
|
||||
{
|
||||
@ -186,7 +186,7 @@ protected:
|
||||
XML_SetEndElementHandler (m_p, fEnable ? EndElementHandler : nullptr);
|
||||
}
|
||||
|
||||
// @cmember Enable/Disable the element handlers
|
||||
// @cmember Enable / Disable the element handlers
|
||||
|
||||
void EnableElementHandler (bool fEnable = true)
|
||||
{
|
||||
@ -195,7 +195,7 @@ protected:
|
||||
EnableEndElementHandler (fEnable);
|
||||
}
|
||||
|
||||
// @cmember Enable/Disable the character data handler
|
||||
// @cmember Enable / Disable the character data handler
|
||||
|
||||
void EnableCharacterDataHandler (bool fEnable = true)
|
||||
{
|
||||
@ -203,7 +203,7 @@ protected:
|
||||
XML_SetCharacterDataHandler (m_p, fEnable ? CharacterDataHandler : nullptr);
|
||||
}
|
||||
|
||||
// @cmember Enable/Disable the processing instruction handler
|
||||
// @cmember Enable / Disable the processing instruction handler
|
||||
|
||||
void EnableProcessingInstructionHandler (bool fEnable = true)
|
||||
{
|
||||
@ -211,7 +211,7 @@ protected:
|
||||
XML_SetProcessingInstructionHandler (m_p, fEnable ? ProcessingInstructionHandler : nullptr);
|
||||
}
|
||||
|
||||
// @cmember Enable/Disable the comment handler
|
||||
// @cmember Enable / Disable the comment handler
|
||||
|
||||
void EnableCommentHandler (bool fEnable = true)
|
||||
{
|
||||
@ -219,7 +219,7 @@ protected:
|
||||
XML_SetCommentHandler (m_p, fEnable ? CommentHandler : nullptr);
|
||||
}
|
||||
|
||||
// @cmember Enable/Disable the start CDATA section handler
|
||||
// @cmember Enable / Disable the start CDATA section handler
|
||||
|
||||
void EnableStartCdataSectionHandler (bool fEnable = true)
|
||||
{
|
||||
@ -227,7 +227,7 @@ protected:
|
||||
XML_SetStartCdataSectionHandler (m_p, fEnable ? StartCdataSectionHandler : nullptr);
|
||||
}
|
||||
|
||||
// @cmember Enable/Disable the end CDATA section handler
|
||||
// @cmember Enable / Disable the end CDATA section handler
|
||||
|
||||
void EnableEndCdataSectionHandler (bool fEnable = true)
|
||||
{
|
||||
@ -235,7 +235,7 @@ protected:
|
||||
XML_SetEndCdataSectionHandler (m_p, fEnable ? EndCdataSectionHandler : nullptr);
|
||||
}
|
||||
|
||||
// @cmember Enable/Disable the CDATA section handlers
|
||||
// @cmember Enable / Disable the CDATA section handlers
|
||||
|
||||
void EnableCdataSectionHandler (bool fEnable = true)
|
||||
{
|
||||
@ -244,7 +244,7 @@ protected:
|
||||
EnableEndCdataSectionHandler (fEnable);
|
||||
}
|
||||
|
||||
// @cmember Enable/Disable default handler
|
||||
// @cmember Enable / Disable default handler
|
||||
|
||||
void EnableDefaultHandler (bool fEnable = true, bool fExpand = true)
|
||||
{
|
||||
@ -259,7 +259,7 @@ protected:
|
||||
}
|
||||
}
|
||||
|
||||
// @cmember Enable/Disable external entity ref handler
|
||||
// @cmember Enable / Disable external entity ref handler
|
||||
|
||||
void EnableExternalEntityRefHandler (bool fEnable = true)
|
||||
{
|
||||
@ -267,7 +267,7 @@ protected:
|
||||
XML_SetExternalEntityRefHandler (m_p, fEnable ? ExternalEntityRefHandler : nullptr);
|
||||
}
|
||||
|
||||
// @cmember Enable/Disable unknown encoding handler
|
||||
// @cmember Enable / Disable unknown encoding handler
|
||||
|
||||
void EnableUnknownEncodingHandler (bool fEnable = true)
|
||||
{
|
||||
@ -275,7 +275,7 @@ protected:
|
||||
XML_SetUnknownEncodingHandler (m_p, fEnable ? UnknownEncodingHandler : nullptr);
|
||||
}
|
||||
|
||||
// @cmember Enable/Disable start namespace handler
|
||||
// @cmember Enable / Disable start namespace handler
|
||||
|
||||
void EnableStartNamespaceDeclHandler (bool fEnable = true)
|
||||
{
|
||||
@ -283,7 +283,7 @@ protected:
|
||||
XML_SetStartNamespaceDeclHandler (m_p, fEnable ? StartNamespaceDeclHandler : nullptr);
|
||||
}
|
||||
|
||||
// @cmember Enable/Disable end namespace handler
|
||||
// @cmember Enable / Disable end namespace handler
|
||||
|
||||
void EnableEndNamespaceDeclHandler (bool fEnable = true)
|
||||
{
|
||||
@ -291,7 +291,7 @@ protected:
|
||||
XML_SetEndNamespaceDeclHandler (m_p, fEnable ? EndNamespaceDeclHandler : nullptr);
|
||||
}
|
||||
|
||||
// @cmember Enable/Disable namespace handlers
|
||||
// @cmember Enable / Disable namespace handlers
|
||||
|
||||
void EnableNamespaceDeclHandler (bool fEnable = true)
|
||||
{
|
||||
@ -299,7 +299,7 @@ protected:
|
||||
EnableEndNamespaceDeclHandler (fEnable);
|
||||
}
|
||||
|
||||
// @cmember Enable/Disable the XML declaration handler
|
||||
// @cmember Enable / Disable the XML declaration handler
|
||||
|
||||
void EnableXmlDeclHandler (bool fEnable = true)
|
||||
{
|
||||
@ -307,7 +307,7 @@ protected:
|
||||
XML_SetXmlDeclHandler (m_p, fEnable ? XmlDeclHandler : nullptr);
|
||||
}
|
||||
|
||||
// @cmember Enable/Disable the start DOCTYPE declaration handler
|
||||
// @cmember Enable / Disable the start DOCTYPE declaration handler
|
||||
|
||||
void EnableStartDoctypeDeclHandler (bool fEnable = true)
|
||||
{
|
||||
@ -315,7 +315,7 @@ protected:
|
||||
XML_SetStartDoctypeDeclHandler (m_p, fEnable ? StartDoctypeDeclHandler : nullptr);
|
||||
}
|
||||
|
||||
// @cmember Enable/Disable the end DOCTYPE declaration handler
|
||||
// @cmember Enable / Disable the end DOCTYPE declaration handler
|
||||
|
||||
void EnableEndDoctypeDeclHandler (bool fEnable = true)
|
||||
{
|
||||
@ -324,7 +324,7 @@ protected:
|
||||
fEnable ? EndDoctypeDeclHandler : nullptr);
|
||||
}
|
||||
|
||||
// @cmember Enable/Disable the DOCTYPE declaration handler
|
||||
// @cmember Enable / Disable the DOCTYPE declaration handler
|
||||
|
||||
void EnableDoctypeDeclHandler (bool fEnable = true)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user