From 0d0f6b62b6c3607b9d3bda7ad07bb043286e0fe1 Mon Sep 17 00:00:00 2001 From: ravenal Date: Sun, 17 Oct 2010 15:56:18 +0000 Subject: [PATCH] Attempted to fix PlayerMobile.cs issue with ContextMenu throwing an InvalidCastException in regards to Party. --- Scripts/Mobiles/PlayerMobile.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Scripts/Mobiles/PlayerMobile.cs b/Scripts/Mobiles/PlayerMobile.cs index 2bc4e8fcf..d7d791bc5 100644 --- a/Scripts/Mobiles/PlayerMobile.cs +++ b/Scripts/Mobiles/PlayerMobile.cs @@ -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 ) ); } }