Changeset 312 for binary-improvements/7dtd-server-fixes
- Timestamp:
- Jan 18, 2018, 4:56:02 PM (7 years ago)
- Location:
- binary-improvements/7dtd-server-fixes
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/7dtd-server-fixes/7dtd-server-fixes.csproj
r306 r312 93 93 <Compile Include="src\PersistentData\Attributes.cs" /> 94 94 <Compile Include="src\JSON\JSONValue.cs" /> 95 <Compile Include="src\LiveData\EntityFilterList.cs" /> 95 96 </ItemGroup> 96 97 <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> -
binary-improvements/7dtd-server-fixes/ModInfo.xml
r309 r312 5 5 <Description value="Common functions" /> 6 6 <Author value="Christian 'Alloc' Illy" /> 7 <Version value="1 6" />7 <Version value="17" /> 8 8 <Website value="http://7dtd.illy.bz" /> 9 9 </ModInfo> -
binary-improvements/7dtd-server-fixes/src/LiveData/Animals.cs
r307 r312 4 4 namespace AllocsFixes.LiveData 5 5 { 6 public class Animals 6 public class Animals : EntityFilterList<EntityAnimal> 7 7 { 8 public static void Get (List<EntityAnimal> _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];14 8 15 if (entity is EntityAnimal) { 16 EntityAnimal ea = (EntityAnimal)entity; 9 public static readonly Animals Instance = new Animals (); 17 10 18 if (ea.IsAlive ()) 19 _list.Add (ea); 20 } 11 protected override EntityAnimal predicate (Entity _e) { 12 if (_e is EntityAnimal) { 13 EntityAnimal ea = (EntityAnimal)_e; 14 15 if (ea.IsAlive ()) { 16 return ea; 21 17 } 22 18 } 23 catch (Exception e) { 24 Log.Exception (e); 25 } 26 } 27 28 public static int GetCount () { 29 int count = 0; 30 try { 31 List<Entity> entities = GameManager.Instance.World.Entities.list; 32 for (int i = 0; i < entities.Count; i++) { 33 Entity entity = entities [i]; 34 35 if (entity is EntityAnimal) { 36 EntityAnimal ea = (EntityAnimal)entity; 37 38 if (ea.IsAlive ()) 39 count++; 40 } 41 } 42 } 43 catch (Exception e) { 44 Log.Exception (e); 45 } 46 return count; 19 return null; 47 20 } 48 21 -
binary-improvements/7dtd-server-fixes/src/LiveData/Hostiles.cs
r306 r312 4 4 namespace AllocsFixes.LiveData 5 5 { 6 public class Hostiles 6 public class Hostiles : EntityFilterList<EntityEnemy> 7 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];14 8 15 if (entity is EntityEnemy) { 16 if (entity.IsAlive ()) 17 _list.Add (entity as EntityEnemy); 18 } 9 public static readonly Hostiles Instance = new Hostiles (); 10 11 override protected EntityEnemy predicate (Entity _e) { 12 if (_e is EntityEnemy) { 13 if (_e.IsAlive ()) { 14 return _e as EntityEnemy; 19 15 } 20 16 } 21 catch (Exception e) { 22 Log.Exception (e); 23 } 17 return null; 24 18 } 25 19 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];32 33 if (entity.entityType == EntityType.Zombie) {34 EntityEnemy ee = (EntityEnemy)entity;35 36 if (ee.IsAlive ())37 count++;38 }39 }40 }41 catch (Exception e) {42 Log.Exception (e);43 }44 return count;45 }46 20 } 47 21 }
Note:
See TracChangeset
for help on using the changeset viewer.