String patch, thanks Carmina

This commit is contained in:
mark 2006-12-12 19:22:43 +00:00
parent 332effd18f
commit 88658b58e2
15 changed files with 33 additions and 33 deletions

View file

@ -355,7 +355,7 @@ namespace Server.Commands
if ( entry != null )
sc.Object = entry.Text;
if ( sc.Command == "" && sc.Object == "" )
if ( sc.Command.Length == 0 && sc.Object.Length == 0 )
m_Batch.BatchCommands.RemoveAt( i );
}
@ -455,4 +455,4 @@ namespace Server.Commands
m_From.SendGump( new BatchGump( m_From, m_Batch ) );
}
}
}
}

View file

@ -56,7 +56,7 @@ namespace Server.Engines.Chat
{
newValue = value.Trim();
if ( newValue == null || newValue == String.Empty )
if ( String.IsNullOrEmpty( newValue ) )
newValue = null;
}
@ -545,4 +545,4 @@ namespace Server.Engines.Chat
AddChannel( name ).AlwaysAvailable = true;
}
}
}
}

View file

@ -656,7 +656,7 @@ namespace Server.Engines.Craft
if ( res.MessageNumber > 0 )
message = res.MessageNumber;
else if ( res.MessageString != null && res.MessageString != String.Empty )
else if ( !String.IsNullOrEmpty( res.MessageString ) )
message = res.MessageString;
else
message = 502925; // You don't have the resources required to make that item.
@ -1306,4 +1306,4 @@ namespace Server.Engines.Craft
}
}
}
}
}

View file

@ -32,7 +32,7 @@ namespace Server.Engines.Craft
{
if ( m_MessageNumber > 0 )
from.SendLocalizedMessage( m_MessageNumber );
else if ( m_MessageString != null && m_MessageString != String.Empty )
else if ( !String.IsNullOrEmpty( m_MessageString ) )
from.SendMessage( m_MessageString );
else
from.SendLocalizedMessage( 502925 ); // You don't have the resources required to make that item.
@ -68,4 +68,4 @@ namespace Server.Engines.Craft
get { return m_Amount; }
}
}
}
}

View file

@ -138,7 +138,7 @@ namespace Server.Engines.VeteranRewards
string tag = acct.GetTag( "numRewardsChosen" );
if ( tag == null || tag == "" )
if ( String.IsNullOrEmpty( tag ) )
cur = 0;
else
cur = Utility.ToInt32( tag );
@ -364,4 +364,4 @@ namespace Server.Engines.VeteranRewards
{
bool IsRewardItem{ get; set; }
}
}
}

View file

@ -55,7 +55,7 @@ namespace Server.Guilds
string s = guild.Charter;
if( s == null || s == "" )
if( String.IsNullOrEmpty( s ) )
s = "The guild leader has not yet set the guild charter.";
AddHtml( 65, 216, 480, 80, s, true, true );
@ -172,4 +172,4 @@ namespace Server.Guilds
}
}
}
}
}

View file

@ -25,7 +25,7 @@ namespace Server.Gumps
AddHtmlLocalized( 125, 20, 250, 24, 1019070, false, false ); // You have agreed to purchase:
if ( vi.Description != null && vi.Description != "" )
if ( !String.IsNullOrEmpty( vi.Description ) )
AddLabel( 125, 45, 0, vi.Description );
else
AddHtmlLocalized( 125, 45, 250, 24, 1019072, false, false ); // an item without a description
@ -957,4 +957,4 @@ namespace Server.Gumps
}
}
}
}
}

View file

@ -130,7 +130,7 @@ namespace Server.Items
{
string line = box.Topic[i];
if ( line != null && line != "" )
if ( !String.IsNullOrEmpty( line ) )
AddLabelCropped( 30, 90 + i * 20, 340, 20, 0x3E3, line );
}
@ -389,4 +389,4 @@ namespace Server.Items
int version = reader.ReadEncodedInt();
}
}
}
}

View file

@ -95,12 +95,12 @@ namespace Server.Items
public override void AddNameProperty( ObjectPropertyList list )
{
list.Add( 1054131, m_Charges.ToString() + ( m_PetName == "" ? "\t " : "\t" + m_PetName ) ); // a crystal ball of pet summoning: [charges: ~1_charges~] : [linked pet: ~2_petName~]
list.Add( 1054131, m_Charges.ToString() + ( m_PetName.Length == 0 ? "\t " : "\t" + m_PetName ) ); // a crystal ball of pet summoning: [charges: ~1_charges~] : [linked pet: ~2_petName~]
}
public override void OnSingleClick( Mobile from )
{
LabelTo( from, 1054131, m_Charges.ToString() + ( m_PetName == "" ? "\t " : "\t" + m_PetName ) ); // a crystal ball of pet summoning: [charges: ~1_charges~] : [linked pet: ~2_petName~]
LabelTo( from, 1054131, m_Charges.ToString() + ( m_PetName.Length == 0 ? "\t " : "\t" + m_PetName ) ); // a crystal ball of pet summoning: [charges: ~1_charges~] : [linked pet: ~2_petName~]
}
private delegate void BallCallback( Mobile from );
@ -342,4 +342,4 @@ namespace Server.Items
}
}
}
}
}

View file

@ -96,12 +96,12 @@ namespace Server.Items
public override void AddNameProperty( ObjectPropertyList list )
{
list.Add( 1054000, m_Charges.ToString() + ( m_Inscription == "" ? "\t " : " :\t" + m_Inscription ) ); // a bracelet of binding : ~1_val~ ~2_val~
list.Add( 1054000, m_Charges.ToString() + ( m_Inscription.Length == 0 ? "\t " : " :\t" + m_Inscription ) ); // a bracelet of binding : ~1_val~ ~2_val~
}
public override void OnSingleClick( Mobile from )
{
LabelTo( from, 1054000, m_Charges.ToString() + ( m_Inscription == "" ? "\t " : " :\t" + m_Inscription ) ); // a bracelet of binding : ~1_val~ ~2_val~
LabelTo( from, 1054000, m_Charges.ToString() + ( m_Inscription.Length == 0 ? "\t " : " :\t" + m_Inscription ) ); // a bracelet of binding : ~1_val~ ~2_val~
}
public override void GetContextMenuEntries( Mobile from, List<ContextMenuEntry> list )
@ -471,4 +471,4 @@ namespace Server.Items
}
}
}
}
}

View file

@ -69,7 +69,7 @@ namespace Server.Misc
private static string Combine( string path1, string path2 )
{
if ( path1 == "" )
if ( path1.Length == 0 )
return path2;
return Path.Combine( path1, path2 );
@ -257,4 +257,4 @@ namespace Server.Misc
);
}
}
}
}

View file

@ -91,7 +91,7 @@ namespace Server
{
string type = element.GetAttribute( "type" );
if ( type == null || type == String.Empty )
if ( String.IsNullOrEmpty( type ) )
continue;
try
@ -106,4 +106,4 @@ namespace Server
}
}
}
}
}

View file

@ -46,7 +46,7 @@ namespace Server.Misc
footer = "This profile has been locked.";
}
if ( footer == "" && beholder == beheld )
if ( footer.Length == 0 && beholder == beheld )
footer = GetAccountDuration( beheld );
string body = beheld.Profile;
@ -95,4 +95,4 @@ namespace Server.Misc
return false;
}
}
}
}

View file

@ -232,7 +232,7 @@ namespace Server.Mobiles
else
item.LabelTo( from, 1043304, vi.Price.ToString() ); // Price: ~1_COST~
if ( vi.Description != null && vi.Description != "" )
if ( !String.IsNullOrEmpty( vi.Description ) )
{
// The localized message (1043305) is no longer valid - <br>Seller's Description:<br>"~1_DESC~"
item.LabelTo( from, "Description: {0}", vi.Description );
@ -961,7 +961,7 @@ namespace Server.Mobiles
if ( vi != null )
{
string name;
if ( item.Name != null && item.Name != "" )
if ( !String.IsNullOrEmpty( item.Name ) )
name = item.Name;
else
name = "#" + item.LabelNumber.ToString();
@ -1719,4 +1719,4 @@ namespace Server.Mobiles
Timer.DelayCall( TimeSpan.Zero, new TimerCallback( Delete ) );
}
}
}
}

View file

@ -46,7 +46,7 @@ namespace Server.SkillHandlers
{
foreach ( string line in page.Lines )
{
if ( line.Trim() != "" )
if ( line.Trim().Length != 0 )
return false;
}
}
@ -159,4 +159,4 @@ namespace Server.SkillHandlers
}
}
}
}
}