- Timestamp:
- Dec 12, 2015, 4:08:53 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/7dtd-server-fixes/src/PersistentData/Inventory.cs
r251 r253 59 59 private InvItem CreateInvItem (ItemValue _itemValue, int _count, int _playerId) { 60 60 if (_count > 0 && _itemValue != null && !_itemValue.Equals (ItemValue.None)) { 61 int maxAllowed = ItemClass.list [_itemValue.type].Stacknumber.Value; 62 string name = ItemClass.list [_itemValue.type].GetItemName (); 61 ItemClass itemClass = ItemClass.list [_itemValue.type]; 62 int maxAllowed = itemClass.Stacknumber.Value; 63 string name = itemClass.GetItemName (); 63 64 64 65 if (_count > maxAllowed) { … … 73 74 } 74 75 75 // Figure out the icon's name 76 string icon_name = ""; 76 item.icon = itemClass.GetIconName (); 77 77 78 ItemClass item_class = ItemClass.list [_itemValue.type]; 79 80 if (!PetesUtils.ValidText (icon_name)) { 81 try { 82 icon_name = item_class.GetIconName (); 83 } 84 catch { } 85 } 86 87 if (!PetesUtils.ValidText (icon_name)) { 88 try { 89 icon_name = item_class.MeshFile; 90 } 91 catch { } 92 } 93 94 if (!PetesUtils.ValidText (icon_name)) { 95 try { 96 icon_name = item_class.DropMeshFile; 97 } 98 catch { } 99 } 100 101 if (!PetesUtils.ValidText (icon_name)) 102 icon_name = item_class.GetItemName (); 103 104 if (icon_name.Contains ("\\")) 105 icon_name = icon_name.Substring (icon_name.LastIndexOf ("\"") + 1); 106 107 item.icon = icon_name; 108 109 try { 110 item.iconcolor = item_class.CustomIconTint.ToHexStringRGB (); 111 } 112 catch { 113 item.iconcolor = "FFFFFF"; 114 } 78 item.iconcolor = AllocsUtils.ColorToHex (itemClass.GetIconTint ()); 115 79 116 80 return item;
Note:
See TracChangeset
for help on using the changeset viewer.