Attempted to fix PlayerMobile.cs issue with ContextMenu throwing an InvalidCastException in regards to Party.

This commit is contained in:
ravenal 2010-10-17 15:56:18 +00:00
parent 5f4634fa96
commit 0d0f6b62b6

View file

@ -1492,12 +1492,15 @@ namespace Server.Mobiles
{
if ( Alive && Core.Expansion >= Expansion.AOS )
{
if ( from.Party == null && this.Party == null ) {
Party theirParty = from.Party as Party;
Party ourParty = this.Party as Party;
if ( theirParty == null && ourParty == null ) {
list.Add( new AddToPartyEntry( from, this ) );
} else if ( from.Party != null && ((Party)(from.Party)).Leader == from ) {
if ( this.Party == null ) {
} else if ( theirParty != null && theirParty.Leader == from ) {
if ( ourParty == null ) {
list.Add( new AddToPartyEntry( from, this ) );
} else if ( this.Party == from.Party ) {
} else if ( ourParty == theirParty ) {
list.Add( new RemoveFromPartyEntry( from, this ) );
}
}