Fixes cast errors (#106)

This commit is contained in:
Kamron Batman 2020-04-13 00:11:35 -07:00 committed by GitHub
parent 55fb749f17
commit bc50bea867
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 140 additions and 143 deletions

View file

@ -42,8 +42,12 @@ namespace Server.Commands.Generic
IPooledEnumerable<IEntity> eable = map.GetObjectsInBounds(rect, items, mobiles);
List<object> objs = eable.Where(obj => !mobiles || !(obj is Mobile) || BaseCommand.IsAccessible(from, obj))
.Where(obj => ext.IsValid(obj)).Cast<object>().ToList();
List<object> objs = new List<object>();
foreach (IEntity obj in eable)
if ((!mobiles || obj is Mobile) && BaseCommand.IsAccessible(from, obj) && ext.IsValid(obj))
objs.Add(obj);
eable.Free();
ext.Filter(objs);