public virtual PlayerMobile GetOccupant(int index) { LeverPuzzleRegion region = m_Tiles[index]; if (region?.Occupant?.Alive == true) { return((PlayerMobile)region.Occupant); } return(null); }
public virtual PlayerMobile GetOccupant(int index) { LeverPuzzleRegion region = (LeverPuzzleRegion)this.m_Tiles[index]; if (region != null) { if (region.Occupant != null && region.Occupant.Alive) { return((PlayerMobile)region.Occupant); } } return(null); }