Fixed boolean comparison.

Don't compare booleans to false / true, use them directly.

git-svn-id: http://mc-server.googlecode.com/svn/trunk@1048 0a769ca7-a7f5-676a-18bf-c427514a06d6
master
madmaxoft@gmail.com 2012-11-16 16:03:56 +00:00
parent 052abcabc7
commit b65a22fc1f
5 changed files with 11 additions and 11 deletions

View File

@ -36,11 +36,11 @@ public:
} }
BLOCKTYPE TopBlock = a_World->GetBlock( a_BlockX, a_BlockY + 1, a_BlockZ); BLOCKTYPE TopBlock = a_World->GetBlock( a_BlockX, a_BlockY + 1, a_BlockZ);
if (g_BlockIsSolid[TopBlock] || TopBlock==E_BLOCK_LEAVES) if (g_BlockIsSolid[TopBlock] || (TopBlock == E_BLOCK_LEAVES))
{ {
AddDirection( a_BlockX, a_BlockY, a_BlockZ, a_Dir, true ); AddDirection( a_BlockX, a_BlockY, a_BlockZ, a_Dir, true );
BLOCKTYPE BaseBlock = a_World->GetBlock( a_BlockX, a_BlockY, a_BlockZ); BLOCKTYPE BaseBlock = a_World->GetBlock( a_BlockX, a_BlockY, a_BlockZ);
if (g_BlockIsSolid[BaseBlock] == false && BaseBlock!=E_BLOCK_LEAVES) if (!g_BlockIsSolid[BaseBlock] && (BaseBlock != E_BLOCK_LEAVES))
{ {
AddDirection( a_BlockX, a_BlockY, a_BlockZ, a_Dir, false ); AddDirection( a_BlockX, a_BlockY, a_BlockZ, a_Dir, false );
a_World->SetBlock( a_BlockX, a_BlockY, a_BlockZ, E_BLOCK_VINES, 0); a_World->SetBlock( a_BlockX, a_BlockY, a_BlockZ, E_BLOCK_VINES, 0);
@ -50,7 +50,7 @@ public:
AddDirection( a_BlockX, a_BlockY, a_BlockZ, a_Dir, true ); AddDirection( a_BlockX, a_BlockY, a_BlockZ, a_Dir, true );
BLOCKTYPE BaseBlock = a_World->GetBlock( a_BlockX, a_BlockY, a_BlockZ); BLOCKTYPE BaseBlock = a_World->GetBlock( a_BlockX, a_BlockY, a_BlockZ);
return g_BlockIsSolid[BaseBlock] || BaseBlock==E_BLOCK_LEAVES; return (g_BlockIsSolid[BaseBlock] || (BaseBlock == E_BLOCK_LEAVES));
} }

View File

@ -908,7 +908,7 @@ void cClientHandle::HandleUseEntity(int a_TargetEntityID, bool a_IsLeftClick)
{ {
virtual bool Item(cEntity * a_Entity) override virtual bool Item(cEntity * a_Entity) override
{ {
if (a_Entity->GetWorld()->IsPVPEnabled() == false) if (!a_Entity->GetWorld()->IsPVPEnabled())
{ {
// PVP is disabled // PVP is disabled
if (a_Entity->IsA("cPlayer") && Instigator->IsA("cPlayer")) if (a_Entity->IsA("cPlayer") && Instigator->IsA("cPlayer"))

View File

@ -127,7 +127,7 @@ void cRoot::Start(void)
cIniFile WebIniFile("webadmin.ini"); cIniFile WebIniFile("webadmin.ini");
if( WebIniFile.ReadFile() ) if( WebIniFile.ReadFile() )
{ {
if( WebIniFile.GetValueB("WebAdmin", "Enabled", false ) == true ) if (WebIniFile.GetValueB("WebAdmin", "Enabled", false ))
{ {
LOG("Creating WebAdmin..."); LOG("Creating WebAdmin...");
m_WebAdmin = new cWebAdmin(8080); m_WebAdmin = new cWebAdmin(8080);

View File

@ -56,12 +56,12 @@ void cRedstoneSimulator::Simulate( float a_Dt )
if( (*itr).Ticks <= 0 ) if( (*itr).Ticks <= 0 )
{ {
char Block = m_World->GetBlock( (*itr).Position ); char Block = m_World->GetBlock( (*itr).Position );
if( (*itr).bPowerOn == true && Block == E_BLOCK_REDSTONE_REPEATER_OFF ) if ((*itr).bPowerOn && (Block == E_BLOCK_REDSTONE_REPEATER_OFF))
{ {
m_World->FastSetBlock( (*itr).Position.x, (*itr).Position.y, (*itr).Position.z, E_BLOCK_REDSTONE_REPEATER_ON, m_World->GetBlockMeta( (*itr).Position ) ); m_World->FastSetBlock( (*itr).Position.x, (*itr).Position.y, (*itr).Position.z, E_BLOCK_REDSTONE_REPEATER_ON, m_World->GetBlockMeta( (*itr).Position ) );
m_Blocks.push_back( (*itr).Position ); m_Blocks.push_back( (*itr).Position );
} }
else if( (*itr).bPowerOn == false && Block == E_BLOCK_REDSTONE_REPEATER_ON ) else if (!(*itr).bPowerOn && (Block == E_BLOCK_REDSTONE_REPEATER_ON))
{ {
m_World->FastSetBlock( (*itr).Position.x, (*itr).Position.y, (*itr).Position.z, E_BLOCK_REDSTONE_REPEATER_OFF, m_World->GetBlockMeta( (*itr).Position ) ); m_World->FastSetBlock( (*itr).Position.x, (*itr).Position.y, (*itr).Position.z, E_BLOCK_REDSTONE_REPEATER_OFF, m_World->GetBlockMeta( (*itr).Position ) );
m_Blocks.push_back( (*itr).Position ); m_Blocks.push_back( (*itr).Position );
@ -860,11 +860,11 @@ void cRedstoneSimulator::SetRepeater( const Vector3i & a_Position, int a_Ticks,
sRepeaterChange & Change = *itr; sRepeaterChange & Change = *itr;
if( Change.Position.Equals( a_Position ) ) if( Change.Position.Equals( a_Position ) )
{ {
if( Change.bPowerOn && a_bPowerOn == false ) if (Change.bPowerOn && !a_bPowerOn)
{ {
Change.bPowerOffNextTime = true; Change.bPowerOffNextTime = true;
} }
if( a_bPowerOn == true ) if (a_bPowerOn)
{ {
Change.bPowerOffNextTime = false; Change.bPowerOffNextTime = false;
} }

View File

@ -196,7 +196,7 @@ void cWebAdmin::Request_Handler(webserver::http_request* r)
cWebPlugin* WebPlugin = *itr; cWebPlugin* WebPlugin = *itr;
FoundPlugin = WebPlugin->GetName(); FoundPlugin = WebPlugin->GetName();
AString TabName = WebPlugin->GetTabNameForRequest( &Request ).first; AString TabName = WebPlugin->GetTabNameForRequest( &Request ).first;
if( TabName.empty() == false ) if (!TabName.empty())
{ {
FoundPlugin += " - " + TabName; FoundPlugin += " - " + TabName;
} }
@ -239,7 +239,7 @@ void cWebAdmin::Request_Handler(webserver::http_request* r)
if (bDontShowTemplate == false && Split.size() > 1) if (!bDontShowTemplate && (Split.size() > 1))
{ {
Content += "\n<p><a href='" + BaseURL + "'>Go back</a></p>"; Content += "\n<p><a href='" + BaseURL + "'>Go back</a></p>";
} }