- Timestamp:
- Aug 2, 2017, 6:46:15 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/7dtd-server-fixes/src/LiveData/Hostiles.cs
r252 r306 4 4 namespace AllocsFixes.LiveData 5 5 { 6 public class Hostiles 7 { 8 public static List<EntityEnemy> List { 9 get { 10 List<EntityEnemy> lst = new List<EntityEnemy> (); 6 public class Hostiles 7 { 8 public static void Get (List<EntityEnemy> _list) { 9 _list.Clear (); 10 try { 11 List<Entity> entities = GameManager.Instance.World.Entities.list; 12 for (int i = 0; i < entities.Count; i++) { 13 Entity entity = entities [i]; 11 14 12 try { 13 foreach (int ent_id in GameManager.Instance.World.Entities.dict.Keys) { 14 try { 15 Entity entity = GameManager.Instance.World.Entities.dict [ent_id]; 15 if (entity is EntityEnemy) { 16 if (entity.IsAlive ()) 17 _list.Add (entity as EntityEnemy); 18 } 19 } 20 } 21 catch (Exception e) { 22 Log.Exception (e); 23 } 24 } 16 25 17 if (entity.entityType == EntityType.Zombie) { 18 EntityEnemy ee = (EntityEnemy)entity; 26 public static int GetCount () { 27 int count = 0; 28 try { 29 List<Entity> entities = GameManager.Instance.World.Entities.list; 30 for (int i = 0; i < entities.Count; i++) { 31 Entity entity = entities [i]; 19 32 20 if (ee.IsAlive ()) 21 lst.Add (ee); 22 } 23 } 24 catch { } 25 } 26 } 27 catch { } 33 if (entity.entityType == EntityType.Zombie) { 34 EntityEnemy ee = (EntityEnemy)entity; 28 35 29 return lst; 30 } 31 } 32 33 public static int Count { 34 get { return List.Count; } 35 } 36 } 36 if (ee.IsAlive ()) 37 count++; 38 } 39 } 40 } 41 catch (Exception e) { 42 Log.Exception (e); 43 } 44 return count; 45 } 46 } 37 47 } 38 48
Note:
See TracChangeset
for help on using the changeset viewer.