Fixes implicit ternary expressions

This commit is contained in:
Kamron Batman 2018-09-14 14:56:48 -07:00
parent c85b0a740c
commit ff26dfa375
345 changed files with 1905 additions and 2336 deletions

View file

@ -225,15 +225,13 @@ namespace Server.Engines.Harvest
return contains;
}
else
{
int dist = -1;
for ( int i = 0; dist < 0 && i < m_Tiles.Length; ++i )
dist = ( m_Tiles[i] - tileID );
int dist = -1;
return ( dist == 0 );
}
for ( int i = 0; dist < 0 && i < m_Tiles.Length; ++i )
dist = ( m_Tiles[i] - tileID );
return ( dist == 0 );
}
}
}

View file

@ -107,7 +107,8 @@ namespace Server.Engines.Harvest
OnBadHarvestTarget( from, tool, toHarvest );
return;
}
else if ( !def.Validate( tileID ) )
if ( !def.Validate( tileID ) )
{
OnBadHarvestTarget( from, tool, toHarvest );
return;
@ -115,9 +116,9 @@ namespace Server.Engines.Harvest
if ( !CheckRange( from, tool, def, map, loc, true ) )
return;
else if ( !CheckResources( from, tool, def, map, loc, true ) )
if ( !CheckResources( from, tool, def, map, loc, true ) )
return;
else if ( !CheckHarvest( from, tool, def, toHarvest ) )
if ( !CheckHarvest( from, tool, def, toHarvest ) )
return;
if ( SpecialHarvest( from, tool, def, map, loc ) )
@ -341,23 +342,24 @@ namespace Server.Engines.Harvest
OnBadHarvestTarget( from, tool, toHarvest );
return false;
}
else if ( !def.Validate( tileID ) )
if ( !def.Validate( tileID ) )
{
from.EndAction( locked );
OnBadHarvestTarget( from, tool, toHarvest );
return false;
}
else if ( !CheckRange( from, tool, def, map, loc, true ) )
if ( !CheckRange( from, tool, def, map, loc, true ) )
{
from.EndAction( locked );
return false;
}
else if ( !CheckResources( from, tool, def, map, loc, true ) )
if ( !CheckResources( from, tool, def, map, loc, true ) )
{
from.EndAction( locked );
return false;
}
else if ( !CheckHarvest( from, tool, def, toHarvest ) )
if ( !CheckHarvest( from, tool, def, toHarvest ) )
{
from.EndAction( locked );
return false;
@ -424,9 +426,9 @@ namespace Server.Engines.Harvest
if ( !CheckRange( from, tool, def, map, loc, false ) )
return;
else if ( !CheckResources( from, tool, def, map, loc, false ) )
if ( !CheckResources( from, tool, def, map, loc, false ) )
return;
else if ( !CheckHarvest( from, tool, def, toHarvest ) )
if ( !CheckHarvest( from, tool, def, toHarvest ) )
return;
object toLock = GetLock( from, tool, def, toHarvest );

View file

@ -206,7 +206,8 @@ namespace Server.Engines.Harvest
from.SendLocalizedMessage( 501864 ); // You can't mine while riding.
return false;
}
else if ( from.IsBodyMod && !from.Body.IsHuman )
if ( from.IsBodyMod && !from.Body.IsHuman )
{
from.SendLocalizedMessage( 501865 ); // You can't mine while polymorphed.
return false;