@ brodockbr: I dont speak that language but i believe it says something like, the array has been cahncged so i cant contiinue to the next one, that was an error in the last version, teh latest version has this fixed. If this is still a problem, then please reply so i can have a look at is
@x-ray: as i said in that quote u posted, it will increase load and decrease save ( all be it by 1 or 2 milliseconds ). Also that is the only if that needs to be removed:
if you remove the first one you have:
and look at this part:
if this part is executed, then Wanderer will be = null, so we look further down in the script:
if the Wanderer != null IF statement wasnt there, and wander = null ( as i showed possible above ) then it would cause a crash, that is why that if statement is needed. I think if i thought about it for awhile there might be a slightly more efficient way to do this, but it works and isnt called very often so it doesnt matter that much ( although if it was part of the main system i would attempt to improve it ).
I hope this answers everyones questions, if not, please post back.
@x-ray: as i said in that quote u posted, it will increase load and decrease save ( all be it by 1 or 2 milliseconds ). Also that is the only if that needs to be removed:
Code:
public void CheckWanderer()
{
if ( Wanderer == null )
return;
if ( this.Mobiles.Count == 0 )
{
if ( Wanderer != null )
{
if ( !Wanderer.Deleted )
Wanderer.Delete();
Wanderer = null;
}
}
for ( int i = 0; i < Mobiles.Count; ++i )
{
if ( Mobiles[ i ] is PlayerMobile )
{
if ( ((PlayerMobile)Mobiles[ i ]).AccessLevel == AccessLevel.Player && ((PlayerMobile)Mobiles[ i ]).CheckAlive() )
return;
}
}
if ( Wanderer != null )
{
if ( !Wanderer.Deleted )
Wanderer.Delete();
Wanderer = null;
}
}
if you remove the first one you have:
Code:
public void CheckWanderer()
{
if ( Wanderer == null )
return;
if ( this.Mobiles.Count == 0 )
{
if ( !Wanderer.Deleted )
Wanderer.Delete();
Wanderer = null;
}
for ( int i = 0; i < Mobiles.Count; ++i )
{
if ( Mobiles[ i ] is PlayerMobile )
{
if ( ((PlayerMobile)Mobiles[ i ]).AccessLevel == AccessLevel.Player && ((PlayerMobile)Mobiles[ i ]).CheckAlive() )
return;
}
}
if ( Wanderer != null )
{
if ( !Wanderer.Deleted )
Wanderer.Delete();
Wanderer = null;
}
}
and look at this part:
Code:
if ( this.Mobiles.Count == 0 )
{
if ( !Wanderer.Deleted )
Wanderer.Delete();
Wanderer = null;
}
Code:
}
if ( Wanderer != null )
{
if ( !Wanderer.Deleted )
Wanderer.Delete();
Wanderer = null;
}
I hope this answers everyones questions, if not, please post back.