- Timestamp:
- Aug 7, 2022, 3:02:24 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements2/7dtd-server-fixes/src/LandClaimList.cs
r369 r391 20 20 Dictionary<PersistentPlayerData, List<Vector3i>> owners = 21 21 new Dictionary<PersistentPlayerData, List<Vector3i>> (); 22 foreach ( KeyValuePair<Vector3i, PersistentPlayerData> kvpin d) {22 foreach ((Vector3i claimPos, PersistentPlayerData owner) in d) { 23 23 bool allowed = true; 24 24 if (_positionFilters != null) { 25 25 foreach (PositionFilter pf in _positionFilters) { 26 if (!pf (kvp.Key)) { 27 allowed = false; 28 break; 26 if (pf (claimPos)) { 27 continue; 29 28 } 29 30 allowed = false; 31 break; 30 32 } 31 33 } 32 34 33 if (allowed) { 34 if (!owners.ContainsKey (kvp.Value)) { 35 owners.Add (kvp.Value, new List<Vector3i> ()); 36 } 35 if (!allowed) { 36 continue; 37 } 37 38 38 owners [kvp.Value].Add (kvp.Key); 39 if (!owners.ContainsKey (owner)) { 40 owners.Add (owner, new List<Vector3i> ()); 39 41 } 42 43 owners [owner].Add (claimPos); 40 44 } 41 45 42 foreach (KeyValuePair<PersistentPlayerData, List<Vector3i>> kvp in owners) { 43 Player p = PersistentContainer.Instance.Players [kvp.Key.UserIdentifier, false]; 44 if (p == null) { 45 p = new Player (kvp.Key.UserIdentifier); 46 } 46 foreach ((PersistentPlayerData owner, List<Vector3i> claimPositions) in owners) { 47 Player p = PersistentContainer.Instance.Players [owner.UserIdentifier, false] ?? new Player (owner.UserIdentifier); 47 48 48 49 bool allowed = true; 49 50 if (_ownerFilters != null) { 50 51 foreach (OwnerFilter of in _ownerFilters) { 51 if (!of (p)) { 52 allowed = false; 53 break; 52 if (of (p)) { 53 continue; 54 54 } 55 56 allowed = false; 57 break; 55 58 } 56 59 } 57 60 58 if (allowed) { 59 result.Add (p, new List<Vector3i> ()); 60 foreach (Vector3i v in kvp.Value) { 61 result [p].Add (v); 62 } 61 if (!allowed) { 62 continue; 63 } 64 65 result.Add (p, new List<Vector3i> ()); 66 foreach (Vector3i v in claimPositions) { 67 result [p].Add (v); 63 68 } 64 69 }
Note:
See TracChangeset
for help on using the changeset viewer.