/// <summary> /// Returns a list of objects that are currently visible from a dungeon cell /// </summary> private List <PhysicsObj> GetVisibleObjects(EnvCell cell, VisibleObjectType type) { var visibleObjs = new List <PhysicsObj>(); // add objects from current cell cell.AddObjectListTo(visibleObjs); // add objects from visible cells foreach (var envCell in cell.VisibleCells.Values) { if (envCell != null) { envCell.AddObjectListTo(visibleObjs); } } // if SeenOutside, add objects from outdoor landblock if (cell.SeenOutside) { var outsideObjs = PhysicsObj.CurLandblock.GetServerObjects(true).Where(i => !(i.CurCell is EnvCell indoors) || indoors.SeenOutside); visibleObjs.AddRange(outsideObjs); } return(ApplyFilter(visibleObjs, type).Where(i => !i.DatObject && i.ID != PhysicsObj.ID).Distinct().ToList()); }
/// <summary> /// Returns a list of objects that are currently visible from a dungeon cell /// </summary> private List <PhysicsObj> GetVisibleObjects(EnvCell cell, VisibleObjectType type) { var visibleObjs = new List <PhysicsObj>(); // add objects from current cell cell.AddObjectListTo(visibleObjs); // add objects from visible cells foreach (var envCell in cell.VisibleCells.Values) { if (envCell != null) { envCell.AddObjectListTo(visibleObjs); } } return(ApplyFilter(visibleObjs, type).Where(i => !i.DatObject && i.ID != PhysicsObj.ID).Distinct().ToList()); }