Remove a redundant foreach.

This commit is contained in:
UnknownShadow200 2016-08-15 15:30:19 +10:00
parent bd1f2c9597
commit 25b8f453ad
2 changed files with 4 additions and 7 deletions

View File

@ -166,9 +166,6 @@ namespace ClassicalSharp.Entities {
}
void MoveNormal( float xMoving, float zMoving, float factor, Vector3 drag, float gravity, float yMul ) {
if(entity.BlockUnderFeet == 8 || entity.BlockUnderFeet == 9 || entity.BlockUnderFeet == 10 || entity.BlockUnderFeet == 11) {
entity.Velocity.Y += 2; entity.Velocity.Y = 0;
}
AdjHeadingVelocity( zMoving, xMoving, factor );
Move( xMoving, zMoving, factor, drag, gravity, yMul );
}

View File

@ -163,13 +163,13 @@ namespace ClassicalSharp {
static void LoadFrom( StreamReader reader ) {
string line;
// remove all the unchanged options
List<string> toRemoveKeys = new List<string>();
List<string> toRemove = new List<string>();
foreach( KeyValuePair<string, string> kvp in OptionsSet ) {
if( !OptionsChanged.ContainsKey( kvp.Key ) )
toRemoveKeys.Add( kvp.Key );
toRemove.Add( kvp.Key );
}
foreach( string key in toRemoveKeys )
OptionsSet.Remove( key );
for( int i = 0; i < toRemove.Count; i++ )
OptionsSet.Remove( toRemove[i] );
while( (line = reader.ReadLine()) != null ) {
if( line.Length == 0 || line[0] == '#' ) continue;