Changeset 324 for binary-improvements/AllocsCommands/Commands
- Timestamp:
- Sep 3, 2018, 7:11:10 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/AllocsCommands/Commands/Give.cs
r306 r324 53 53 } 54 54 55 int quality = Constants.cItemMaxQuality; 56 55 57 if (_params.Count == 4) { 56 if (!iv.HasQuality && iv.Attachments == null && iv.Parts == null) { 57 SdtdConsole.Instance.Output ("Item " + _params [1] + " does not support quality."); 58 return; 59 } 60 61 int quality = int.MinValue; 62 if (!int.TryParse (_params [3], out quality) || quality <= 0) { 58 if(!int.TryParse(_params [1], out quality) || quality <= 0) { 63 59 SdtdConsole.Instance.Output ("Quality is not an integer or not greater than zero."); 64 60 return; 65 61 } 62 } 63 64 if (ItemClass.list [iv.type].HasSubItems) { 65 for (int i = 0; i < iv.Modifications.Length; i++) { 66 ItemValue tmp = iv.Modifications[i]; 67 tmp.Quality = quality; 68 iv.Modifications[i] = tmp; 69 } 70 } else if (ItemClass.list [iv.type].HasQuality) { 66 71 iv.Quality = quality; 67 68 // Specific code for weapons with parts and attachmetns69 if (iv.Attachments != null && iv.Attachments.Length != 0) {70 for (int i = 0; i < iv.Attachments.Length; i++) {71 ItemValue att = iv.Attachments[i];72 if (att != null && att.HasQuality) {73 att.Quality = quality;74 }75 }76 }77 78 if (iv.Parts != null && iv.Parts.Length != 0) {79 for (int i = 0; i < iv.Parts.Length; i++) {80 ItemValue part = iv.Parts[i];81 if (part != null && part.HasQuality) {82 part.Quality = quality;83 }84 }85 }86 72 } 87 73
Note:
See TracChangeset
for help on using the changeset viewer.