drag effects have the potential to crash SA clients regardless of any location checking

This commit is contained in:
Mark Sturgill 2013-10-23 21:42:33 -07:00
parent 28744d486e
commit 5b03ef628e

View file

@ -4498,9 +4498,10 @@ namespace Server
IPooledEnumerable<NetState> eable = map.GetClientsInRange(m_Location);
Packet p = null;
bool sameLoc = false;
foreach(NetState ns in eable) {
if (ns.StygianAbyss)
continue;
foreach( NetState ns in eable ) {
if( ns.Mobile != this && ns.Mobile.CanSee( this ) && ns.Mobile.InLOS( this ) && ns.Mobile.CanSee( root ) ) {
if (p == null) {
IEntity trg;
@ -4509,15 +4510,10 @@ namespace Server
trg = new Entity(Serial.Zero, item.Location, map);
else
trg = new Entity(((Item)root).Serial, ((Item)root).Location, map);
if (m_Location == trg.Location)
sameLoc = true;
=
p = Packet.Acquire(new DragEffect(this, trg, item.ItemID, item.Hue, item.Amount));
}
if ( ns.StygianAbyss && sameLoc )
continue; // prevents crash
ns.Send( p );
}
}