using System; using System.Collections.Generic; namespace AllocsFixes.LiveData { public class Animals { public static List List { get { List lst = new List (); try { foreach (object base_entity in GameManager.Instance.World.Entities.list) { try { Entity entity = (Entity)base_entity; // Kind of hack-ish, but the game is legitimately setting the base type of animals ('entityType') to enum 0 ('EntityType.Unknown'). if ((entity.entityType == EntityType.Animal) || (base_entity.GetType ().ToString ().ToLower ().Contains ("animal"))) { EntityAnimal ea = (EntityAnimal)entity; if (ea.IsAlive ()) lst.Add (ea); } } catch { } } } catch { } return lst; } } public static int Count { get { return List.Count; } } } }