- Timestamp:
- Jan 19, 2019, 6:12:21 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/7dtd-server-fixes/src/PersistentData/Inventory.cs
r326 r351 15 15 } 16 16 17 public void Update (PlayerDataFile pdf) {17 public void Update (PlayerDataFile _pdf) { 18 18 lock (this) { 19 19 //Log.Out ("Updating player inventory - player id: " + pdf.id); 20 ProcessInv (bag, pdf.bag,pdf.id);21 ProcessInv (belt, pdf.inventory,pdf.id);22 ProcessEqu ( pdf.equipment,pdf.id);20 ProcessInv (bag, _pdf.bag, _pdf.id); 21 ProcessInv (belt, _pdf.inventory, _pdf.id); 22 ProcessEqu (_pdf.equipment, _pdf.id); 23 23 } 24 24 } 25 25 26 private void ProcessInv (List<InvItem> target, ItemStack[] sourceFields, intid) {27 target.Clear ();28 for (int i = 0; i < sourceFields.Length; i++) {29 InvItem item = CreateInvItem ( sourceFields [i].itemValue, sourceFields [i].count,id);30 if (item != null && sourceFields [i].itemValue.Modifications != null) {31 ProcessParts ( sourceFields [i].itemValue.Modifications, item,id);26 private void ProcessInv (List<InvItem> _target, ItemStack[] _sourceFields, int _id) { 27 _target.Clear (); 28 for (int i = 0; i < _sourceFields.Length; i++) { 29 InvItem item = CreateInvItem (_sourceFields [i].itemValue, _sourceFields [i].count, _id); 30 if (item != null && _sourceFields [i].itemValue.Modifications != null) { 31 ProcessParts (_sourceFields [i].itemValue.Modifications, item, _id); 32 32 } 33 33 34 target.Add (item);34 _target.Add (item); 35 35 } 36 36 } 37 37 38 private void ProcessEqu (Equipment sourceEquipment, int _playerId) {39 equipment = new InvItem[ sourceEquipment.GetSlotCount ()];40 for (int i = 0; i < sourceEquipment.GetSlotCount (); i++) {41 equipment [i] = CreateInvItem ( sourceEquipment.GetSlotItem (i), 1, _playerId);38 private void ProcessEqu (Equipment _sourceEquipment, int _playerId) { 39 equipment = new InvItem[_sourceEquipment.GetSlotCount ()]; 40 for (int i = 0; i < _sourceEquipment.GetSlotCount (); i++) { 41 equipment [i] = CreateInvItem (_sourceEquipment.GetSlotItem (i), 1, _playerId); 42 42 } 43 43 }
Note:
See TracChangeset
for help on using the changeset viewer.