- Timestamp:
- Oct 29, 2019, 11:20:45 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/AllocsCommands/Commands/RemoveLandProtection.cs
r326 r359 58 58 59 59 private void removeByPosition (List<string> _coords) { 60 try { 61 int x, y, z; 62 int.TryParse (_coords [0], out x); 63 int.TryParse (_coords [1], out y); 64 int.TryParse (_coords [2], out z); 60 int x, y, z; 61 int.TryParse (_coords [0], out x); 62 int.TryParse (_coords [1], out y); 63 int.TryParse (_coords [2], out z); 65 64 66 67 68 69 65 if (x == int.MinValue || y == int.MinValue || z == int.MinValue) { 66 SdtdConsole.Instance.Output ("At least one of the given coordinates is not a valid integer"); 67 return; 68 } 70 69 71 70 Vector3i v = new Vector3i (x, y, z); 72 71 73 72 PersistentPlayerList ppl = GameManager.Instance.GetPersistentPlayerList (); 74 73 75 76 77 78 79 80 74 Dictionary<Vector3i, PersistentPlayerData> d = ppl.m_lpBlockMap; 75 if (d == null || !d.ContainsKey (v)) { 76 SdtdConsole.Instance.Output ( 77 "No land protection block at the given position or not a valid position. Use \"listlandprotection\" to get a list of keystones."); 78 return; 79 } 81 80 82 81 BlockChangeInfo bci = new BlockChangeInfo (v, new BlockValue (0), true, false); 83 82 84 85 83 List<BlockChangeInfo> changes = new List<BlockChangeInfo> (); 84 changes.Add (bci); 86 85 87 86 GameManager.Instance.SetBlocksRPC (changes); 88 87 89 SdtdConsole.Instance.Output ("Land protection block at (" + v + ") removed"); 90 } catch (Exception e) { 91 Log.Out ("Error in RemoveLandProtection.removeByPosition: " + e); 92 } 88 SdtdConsole.Instance.Output ("Land protection block at (" + v + ") removed"); 93 89 } 94 90
Note:
See TracChangeset
for help on using the changeset viewer.