From cc001df65ee6c668a0b31c7460e2bc854f5d57c1 Mon Sep 17 00:00:00 2001 From: xavier Date: Sat, 30 Jul 2011 13:55:08 +0000 Subject: [PATCH] sanity checks. --- Scripts/Mobiles/PlayerMobile.cs | 2 +- Scripts/Skills/Stealth.cs | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Scripts/Mobiles/PlayerMobile.cs b/Scripts/Mobiles/PlayerMobile.cs index 22bad9874..09b4c52e8 100644 --- a/Scripts/Mobiles/PlayerMobile.cs +++ b/Scripts/Mobiles/PlayerMobile.cs @@ -3744,7 +3744,7 @@ namespace Server.Mobiles if ( !this.Young ) return false; - if ( !((BaseRegion)Region).YoungProtected ) + if ( Region is BaseRegion && !((BaseRegion)Region).YoungProtected ) return false; if( from is BaseCreature && ((BaseCreature)from).IgnoreYoungProtection ) diff --git a/Scripts/Skills/Stealth.cs b/Scripts/Skills/Stealth.cs index bd61a8868..884844849 100644 --- a/Scripts/Skills/Stealth.cs +++ b/Scripts/Skills/Stealth.cs @@ -88,8 +88,11 @@ namespace Server.SkillHandlers steps = 1; m.AllowedStealthSteps = steps; + PlayerMobile pm = m as PlayerMobile; // IsStealthing should be moved to Server.Mobiles - pm.IsStealthing = true; + + if( pm != null ) + pm.IsStealthing = true; m.SendLocalizedMessage( 502730 ); // You begin to move quietly.