Fixes casting checks
This commit is contained in:
parent
7ea00fbf4f
commit
03dd5f1926
431 changed files with 5616 additions and 6250 deletions
|
|
@ -62,19 +62,19 @@ namespace Server.Guilds
|
|||
return -1;
|
||||
else if ( y == null )
|
||||
return 1;
|
||||
|
||||
|
||||
GuildCompareStatus aStatus = GuildCompareStatus.Peace;
|
||||
GuildCompareStatus bStatus = GuildCompareStatus.Peace;
|
||||
|
||||
if( m_Guild.IsAlly( x ) )
|
||||
if ( m_Guild.IsAlly( x ) )
|
||||
aStatus = GuildCompareStatus.Ally;
|
||||
else if( m_Guild.IsWar( x ) )
|
||||
else if ( m_Guild.IsWar( x ) )
|
||||
aStatus = GuildCompareStatus.War;
|
||||
|
||||
|
||||
if( m_Guild.IsAlly( y ) )
|
||||
|
||||
if ( m_Guild.IsAlly( y ) )
|
||||
bStatus = GuildCompareStatus.Ally;
|
||||
else if( m_Guild.IsWar( y ) )
|
||||
else if ( m_Guild.IsWar( y ) )
|
||||
bStatus = GuildCompareStatus.War;
|
||||
|
||||
return ((int)aStatus).CompareTo( (int)bStatus );
|
||||
|
|
@ -106,7 +106,7 @@ namespace Server.Guilds
|
|||
GuildDisplayType m_Display;
|
||||
TextDefinition m_LowerText;
|
||||
|
||||
public GuildDiplomacyGump( PlayerMobile pm, Guild g )
|
||||
public GuildDiplomacyGump( PlayerMobile pm, Guild g )
|
||||
: this( pm, g, GuildDiplomacyGump.NameComparer.Instance, true, "", 0, GuildDisplayType.All, Utility.CastConvertList<BaseGuild, Guild>( new List<BaseGuild>( Guild.List.Values ) ), (1063136 + (int)GuildDisplayType.All) )
|
||||
{
|
||||
}
|
||||
|
|
@ -121,7 +121,7 @@ namespace Server.Guilds
|
|||
{
|
||||
}
|
||||
|
||||
public GuildDiplomacyGump( PlayerMobile pm, Guild g, bool ascending, string filter, int startNumber, List<Guild> list, TextDefinition lowerText )
|
||||
public GuildDiplomacyGump( PlayerMobile pm, Guild g, bool ascending, string filter, int startNumber, List<Guild> list, TextDefinition lowerText )
|
||||
: this( pm, g, GuildDiplomacyGump.NameComparer.Instance, ascending, filter, startNumber, GuildDisplayType.All, list, lowerText )
|
||||
{
|
||||
}
|
||||
|
|
@ -145,7 +145,7 @@ namespace Server.Guilds
|
|||
{
|
||||
base.PopulateGump();
|
||||
|
||||
AddHtmlLocalized( 431, 43, 110, 26, 1062978, 0xF, false, false ); // Diplomacy
|
||||
AddHtmlLocalized( 431, 43, 110, 26, 1062978, 0xF, false, false ); // Diplomacy
|
||||
}
|
||||
|
||||
protected override TextDefinition[] GetValuesFor( Guild g, int aryLength )
|
||||
|
|
@ -158,14 +158,14 @@ namespace Server.Guilds
|
|||
defs[2] = 3000085; //Peace
|
||||
|
||||
|
||||
if( guild.IsAlly( g ) )
|
||||
if ( guild.IsAlly( g ) )
|
||||
{
|
||||
if( guild.Alliance.Leader == g )
|
||||
if ( guild.Alliance.Leader == g )
|
||||
defs[2] = 1063237; // Alliance Leader
|
||||
else
|
||||
defs[2] = 1062964; // Ally
|
||||
}
|
||||
else if( guild.IsWar( g ) )
|
||||
else if ( guild.IsWar( g ) )
|
||||
{
|
||||
defs[2] = 3000086; // War
|
||||
}
|
||||
|
|
@ -175,18 +175,18 @@ namespace Server.Guilds
|
|||
|
||||
public override bool HasRelationship( Guild g )
|
||||
{
|
||||
if( g == guild )
|
||||
if ( g == guild )
|
||||
return false;
|
||||
|
||||
if( guild.FindPendingWar( g ) != null )
|
||||
if ( guild.FindPendingWar( g ) != null )
|
||||
return true;
|
||||
|
||||
AllianceInfo alliance = guild.Alliance;
|
||||
|
||||
if( alliance != null )
|
||||
if ( alliance != null )
|
||||
{
|
||||
Guild leader = alliance.Leader;
|
||||
|
||||
|
||||
if ( leader != null )
|
||||
{
|
||||
if ( guild == leader && alliance.IsPendingMember( g ) || g == leader && alliance.IsPendingMember( guild ) )
|
||||
|
|
@ -209,7 +209,7 @@ namespace Server.Guilds
|
|||
else if ( m_LowerText != null && m_LowerText.String != null )
|
||||
AddHtml( 66, 153 + itemNumber * 28, 280, 26, Color( m_LowerText.String, 0x99 ), false, false );
|
||||
|
||||
if( AllowAdvancedSearch )
|
||||
if ( AllowAdvancedSearch )
|
||||
{
|
||||
AddBackground( 350, 148 + itemNumber * 28, 200, 26, 0x2486 );
|
||||
AddButton( 355, 153 + itemNumber * 28, 0x845, 0x846, 8, GumpButtonType.Reply, 0 );
|
||||
|
|
@ -220,18 +220,18 @@ namespace Server.Guilds
|
|||
|
||||
protected override bool IsFiltered( Guild g, string filter )
|
||||
{
|
||||
if( g == null )
|
||||
if ( g == null )
|
||||
return true;
|
||||
|
||||
switch( m_Display )
|
||||
{
|
||||
case GuildDisplayType.Relations:
|
||||
{
|
||||
//if( !( guild.IsWar( g ) || guild.IsAlly( g ) ) )
|
||||
//if ( !( guild.IsWar( g ) || guild.IsAlly( g ) ) )
|
||||
|
||||
if( !( guild.FindActiveWar( g ) != null || guild.IsAlly( g ) ) ) //As per OSI, only the guild leader wars show up under the sorting by relation
|
||||
if ( !( guild.FindActiveWar( g ) != null || guild.IsAlly( g ) ) ) //As per OSI, only the guild leader wars show up under the sorting by relation
|
||||
return true;
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
case GuildDisplayType.AwaitingAction:
|
||||
|
|
@ -247,7 +247,7 @@ namespace Server.Guilds
|
|||
{
|
||||
get
|
||||
{
|
||||
if( m_Display == GuildDisplayType.All )
|
||||
if ( m_Display == GuildDisplayType.All )
|
||||
return base.WillFilter;
|
||||
|
||||
return true;
|
||||
|
|
@ -262,7 +262,7 @@ namespace Server.Guilds
|
|||
|
||||
public override Gump GetObjectInfoGump( PlayerMobile pm, Guild g, Guild o )
|
||||
{
|
||||
if( guild == o )
|
||||
if ( guild == o )
|
||||
return new GuildInfoGump( pm, g );
|
||||
|
||||
return new OtherGuildInfo( pm, g, (Guild)o ) ;
|
||||
|
|
@ -274,10 +274,10 @@ namespace Server.Guilds
|
|||
|
||||
PlayerMobile pm = sender.Mobile as PlayerMobile;
|
||||
|
||||
if( pm == null || !IsMember( pm, guild ) )
|
||||
if ( pm == null || !IsMember( pm, guild ) )
|
||||
return;
|
||||
|
||||
if( AllowAdvancedSearch && info.ButtonID == 8 )
|
||||
if ( AllowAdvancedSearch && info.ButtonID == 8 )
|
||||
pm.SendGump( new GuildAdvancedSearchGump( pm, guild, m_Display, new SearchSelectionCallback( AdvancedSearch_Callback ) ));
|
||||
|
||||
}
|
||||
|
|
@ -288,4 +288,4 @@ namespace Server.Guilds
|
|||
ResendGump();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue