From 08f3b44f5457e1f507c28834b9c9776e50e2ef05 Mon Sep 17 00:00:00 2001 From: krrios Date: Sat, 8 Sep 2007 07:22:59 +0000 Subject: [PATCH] fixed drop exploit --- Server/Mobile.cs | 17 ++++++++++------- Server/Network/PacketHandlers.cs | 6 +++--- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/Server/Mobile.cs b/Server/Mobile.cs index 2ffbac919..4fa3bf6c0 100644 --- a/Server/Mobile.cs +++ b/Server/Mobile.cs @@ -3535,7 +3535,7 @@ namespace Server if( holding != null ) { - if( !holding.Deleted && holding.Map == Map.Internal ) + if ( !holding.Deleted && holding.HeldBy == this && holding.Map == Map.Internal ) AddToBackpack( holding ); Holding = null; @@ -4392,10 +4392,11 @@ namespace Server Mobile from = this; Item item = from.Holding; - if( item == null ) + from.Holding = null; + + if ( item == null || item.HeldBy != from || item.Map != Map.Internal ) return false; - from.Holding = null; bool bounced = true; item.SetLastMoved(); @@ -4418,10 +4419,11 @@ namespace Server Mobile from = this; Item item = from.Holding; - if( item == null ) + from.Holding = null; + + if ( item == null || item.HeldBy != from || item.Map != Map.Internal ) return false; - from.Holding = null; bool bounced = true; item.SetLastMoved(); @@ -4444,10 +4446,11 @@ namespace Server Mobile from = this; Item item = from.Holding; - if( item == null ) + from.Holding = null; + + if ( item == null || item.HeldBy != from || item.Map != Map.Internal ) return false; - from.Holding = null; bool bounced = true; item.SetLastMoved(); diff --git a/Server/Network/PacketHandlers.cs b/Server/Network/PacketHandlers.cs index 7cc53b7f4..5231a13ed 100644 --- a/Server/Network/PacketHandlers.cs +++ b/Server/Network/PacketHandlers.cs @@ -964,11 +964,11 @@ namespace Server.Network Mobile from = state.Mobile; Item item = from.Holding; - if ( item == null ) - return; - from.Holding = null; + if ( item == null || item.Deleted || item.HeldBy != from || item.Map != Map.Internal ) + return; + pvSrc.Seek( 5, SeekOrigin.Current ); Mobile to = World.FindMobile( pvSrc.ReadInt32() );