- Timestamp:
- Sep 4, 2018, 2:33:52 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/7dtd-server-fixes/src/PersistentData/Inventory.cs
r325 r326 58 58 59 59 private InvItem CreateInvItem (ItemValue _itemValue, int _count, int _playerId) { 60 if (_count > 0 && _itemValue != null && !_itemValue.Equals (ItemValue.None)) { 61 ItemClass itemClass = ItemClass.list [_itemValue.type]; 62 int maxAllowed = itemClass.Stacknumber.Value; 63 string name = itemClass.GetItemName (); 64 65 if (_count > maxAllowed) { 66 Log.Out ("Player with ID " + _playerId + " has stack for \"" + name + "\" greater than allowed (" + 67 _count + " > " + maxAllowed + ")"); 68 } 69 70 InvItem item = null; 71 if (_itemValue.HasQuality) { 72 item = new InvItem (name, _count, _itemValue.Quality, _itemValue.MaxUseTimes, _itemValue.UseTimes); 73 } else { 74 item = new InvItem (name, _count, -1, _itemValue.MaxUseTimes, _itemValue.UseTimes); 75 } 76 77 item.icon = itemClass.GetIconName (); 78 79 item.iconcolor = AllocsUtils.ColorToHex (itemClass.GetIconTint ()); 80 81 return item; 60 if (_count <= 0 || _itemValue == null || _itemValue.Equals (ItemValue.None)) { 61 return null; 82 62 } 83 63 84 return null; 64 ItemClass itemClass = ItemClass.list [_itemValue.type]; 65 int maxAllowed = itemClass.Stacknumber.Value; 66 string name = itemClass.GetItemName (); 67 68 if (_count > maxAllowed) { 69 Log.Out ("Player with ID " + _playerId + " has stack for \"" + name + "\" greater than allowed (" + 70 _count + " > " + maxAllowed + ")"); 71 } 72 73 InvItem item; 74 if (_itemValue.HasQuality) { 75 item = new InvItem (name, _count, _itemValue.Quality, _itemValue.MaxUseTimes, _itemValue.UseTimes); 76 } else { 77 item = new InvItem (name, _count, -1, _itemValue.MaxUseTimes, _itemValue.UseTimes); 78 } 79 80 item.icon = itemClass.GetIconName (); 81 82 item.iconcolor = AllocsUtils.ColorToHex (itemClass.GetIconTint ()); 83 84 return item; 85 85 } 86 86 }
Note:
See TracChangeset
for help on using the changeset viewer.