- Timestamp:
- Sep 4, 2018, 1:00:48 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/7dtd-server-fixes/src/LandClaimList.cs
r253 r325 1 1 using System; 2 2 using System.Collections.Generic; 3 4 3 using AllocsFixes.PersistentData; 5 4 6 namespace AllocsFixes 7 { 5 namespace AllocsFixes { 8 6 public class LandClaimList { 9 7 public delegate bool OwnerFilter (Player owner); … … 11 9 public delegate bool PositionFilter (Vector3i position); 12 10 13 public static Dictionary<Player, List<Vector3i>> GetLandClaims (OwnerFilter[] _ownerFilters, PositionFilter[] _positionFilters) { 11 public static Dictionary<Player, List<Vector3i>> GetLandClaims (OwnerFilter[] _ownerFilters, 12 PositionFilter[] _positionFilters) { 14 13 Dictionary<Vector3i, PersistentPlayerData> d = GameManager.Instance.GetPersistentPlayerList ().m_lpBlockMap; 15 14 Dictionary<Player, List<Vector3i>> result = new Dictionary<Player, List<Vector3i>> (); 16 15 17 16 if (d != null) { 18 Dictionary<PersistentPlayerData, List<Vector3i>> owners = new Dictionary<PersistentPlayerData, List<Vector3i>> (); 17 Dictionary<PersistentPlayerData, List<Vector3i>> owners = 18 new Dictionary<PersistentPlayerData, List<Vector3i>> (); 19 19 foreach (KeyValuePair<Vector3i, PersistentPlayerData> kvp in d) { 20 20 bool allowed = true; … … 27 27 } 28 28 } 29 29 30 if (allowed) { 30 31 if (!owners.ContainsKey (kvp.Value)) { 31 32 owners.Add (kvp.Value, new List<Vector3i> ()); 32 33 } 34 33 35 owners [kvp.Value].Add (kvp.Key); 34 36 } … … 36 38 37 39 foreach (KeyValuePair<PersistentPlayerData, List<Vector3i>> kvp in owners) { 38 Player p = Persistent Data.PersistentContainer.Instance.Players [kvp.Key.PlayerId, false];40 Player p = PersistentContainer.Instance.Players [kvp.Key.PlayerId, false]; 39 41 if (p == null) { 40 42 p = new Player (kvp.Key.PlayerId); … … 59 61 } 60 62 } 63 61 64 return result; 62 65 } … … 73 76 return p => _f1 (p) || _f2 (p); 74 77 } 75 76 78 } 77 79 } 78
Note:
See TracChangeset
for help on using the changeset viewer.