diff --git a/common/patches/Underfoot.cpp b/common/patches/Underfoot.cpp index cb33a5b9c..a80310626 100644 --- a/common/patches/Underfoot.cpp +++ b/common/patches/Underfoot.cpp @@ -3531,7 +3531,7 @@ char* SerializeItem(const ItemInst *inst, int16 slot_id_in, uint32 *length, uint } // Moofta: if the item has an aug of type 20 (ornamentation) then we use the ID file of that when serializing. - // the only thing we should probably worry about is generating a wear change packet to all cl;ients in zone if someone adds a type 20 aug. + // the only thing we should probably worry about is generating a wear change packet to all clients in zone if someone adds a type 20 aug. if (inst && inst->HasOrnamentation()) //instance is not null and does have an ornament aug (slot 20) { ItemInst* ornamentation = inst->GetOrnamentation(); diff --git a/zone/client.cpp b/zone/client.cpp index 7ab4b48c3..cb98a6b01 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -1907,14 +1907,36 @@ void Client::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) ns->spawn.colors[MaterialFeet].color = GetEquipmentColor(MaterialFeet); } if ((inst = m_inv[SLOT_PRIMARY]) && inst->IsType(ItemClassCommon)) { - item = inst->GetItem(); - if (strlen(item->IDFile) > 2) - ns->spawn.equipment[MaterialPrimary] = atoi(&item->IDFile[2]); + if (inst->HasOrnamentation()) + { + ItemInst* ornament = inst->GetOrnamentation(); + if (strlen(ornament->GetItem()->IDFile) > 2) + { + ns->spawn.equipment[MaterialPrimary]= atoi(&ornament->GetItem()->IDFile[2]); + } + } + else + { + item = inst->GetItem(); + if (strlen(item->IDFile) > 2) + ns->spawn.equipment[MaterialPrimary] = atoi(&item->IDFile[2]); + } } if ((inst = m_inv[SLOT_SECONDARY]) && inst->IsType(ItemClassCommon)) { - item = inst->GetItem(); - if (strlen(item->IDFile) > 2) + if (inst->HasOrnamentation()) + { + ItemInst* ornament = inst->GetOrnamentation(); + if (strlen(ornament->GetItem()->IDFile) > 2) + { + ns->spawn.equipment[MaterialPrimary]= atoi(&ornament->GetItem()->IDFile[2]); + } + } + else + { + item = inst->GetItem(); + if (strlen(item->IDFile) > 2) ns->spawn.equipment[MaterialSecondary] = atoi(&item->IDFile[2]); + } } //these two may be related to ns->spawn.texture diff --git a/zone/inventory.cpp b/zone/inventory.cpp index 45665f4b2..7bb2a4905 100644 --- a/zone/inventory.cpp +++ b/zone/inventory.cpp @@ -1899,26 +1899,25 @@ int32 Client::GetEquipmentMaterial(uint8 material_slot) const const ItemInst* inst = m_inv.GetItem(inventorySlot); if (inst != nullptr) { - - if (strlen(inst->GetItem()->IDFile) > 2) + if (inst->HasOrnamentation()) { - if (inst->HasOrnamentation()) + ItemInst* ornament = inst->GetOrnamentation(); + if (strlen(ornament->GetItem()->IDFile) > 2) { - ItemInst* ornament = inst->GetOrnamentation(); - if (strlen(ornament->GetItem()->IDFile) > 2) - { - return atoi(&ornament->GetItem()->IDFile[2]); - } + return atoi(&ornament->GetItem()->IDFile[2]); } - else + } + else + { + if (strlen(inst->GetItem()->IDFile) > 2) { return atoi(&inst->GetItem()->IDFile[2]); } - } - else //may as well try this, since were going to 0 anyways - { - return inst->GetItem()->Material; - } + else //may as well try this, since were going to 0 anyways + { + return inst->GetItem()->Material; + } + } } } else