Ignore:
Timestamp:
Jun 21, 2024, 2:58:18 PM (6 months ago)
Author:
alloc
Message:

27_32_48

  • V1.0 compatibility
File:
1 edited

Legend:

Unmodified
Added
Removed
  • binary-improvements/MapRendering/API/GetPlayerInventory.cs

    r455 r488  
    9494                        _writer.WriteBeginObject ();
    9595                       
    96                         AddEquipment (ref _writer, "head", _equ, EquipmentSlots.Headgear, _showIconColor, _showIconName);
    97                         _writer.WriteValueSeparator ();
    98                         AddEquipment (ref _writer, "eyes", _equ, EquipmentSlots.Eyewear, _showIconColor, _showIconName);
    99                         _writer.WriteValueSeparator ();
    100                         AddEquipment (ref _writer, "face", _equ, EquipmentSlots.Face, _showIconColor, _showIconName);
     96                        AddEquipment (ref _writer, "head", _equ, EquipmentSlots.Head, _showIconColor, _showIconName);
    10197                        _writer.WriteValueSeparator ();
    10298
    103                         AddEquipment (ref _writer, "armor", _equ, EquipmentSlots.ChestArmor, _showIconColor, _showIconName);
    104                         _writer.WriteValueSeparator ();
    105                         AddEquipment (ref _writer, "jacket", _equ, EquipmentSlots.Jacket, _showIconColor, _showIconName);
    106                         _writer.WriteValueSeparator ();
    107                         AddEquipment (ref _writer, "shirt", _equ, EquipmentSlots.Shirt, _showIconColor, _showIconName);
     99                        AddEquipment (ref _writer, "armor", _equ, EquipmentSlots.Chest, _showIconColor, _showIconName);
    108100                        _writer.WriteValueSeparator ();
    109101
    110                         AddEquipment (ref _writer, "legarmor", _equ, EquipmentSlots.LegArmor, _showIconColor, _showIconName);
    111                         _writer.WriteValueSeparator ();
    112                         AddEquipment (ref _writer, "pants", _equ, EquipmentSlots.Legs, _showIconColor, _showIconName);
    113                         _writer.WriteValueSeparator ();
    114102                        AddEquipment (ref _writer, "boots", _equ, EquipmentSlots.Feet, _showIconColor, _showIconName);
    115103                        _writer.WriteValueSeparator ();
     
    123111                        _writer.WritePropertyName (_slotname);
    124112
    125                         int[] slotindices = XUiM_PlayerEquipment.GetSlotIndicesByEquipmentSlot (_slot);
     113                        int slotindex = (int)_slot;
    126114
    127                         for (int i = 0; i < slotindices.Length; i++) {
    128                                 if (_items? [slotindices [i]] != null) {
    129                                         InvItem item = _items [slotindices [i]];
    130                                        
    131                                         GetJsonForItem (ref _writer, item, _showIconColor, _showIconName);
    132                                         return;
    133                                 }
     115                        if (_items == null || _items[slotindex] == null) {
     116                                // Slot not found / empty
     117                                _writer.WriteNull ();
     118                                return;
    134119                        }
    135 
    136                         // Slot not found / empty
    137                         _writer.WriteNull ();
     120                       
     121                        InvItem item = _items [slotindex];
     122                        GetJsonForItem (ref _writer, item, _showIconColor, _showIconName);
    138123                }
    139124
Note: See TracChangeset for help on using the changeset viewer.