[Cleanup] Move Client::Undye() to client.cpp from #path Command. (#2188)

- Client::Undye() was inside the #path command file.
This commit is contained in:
Kinglykrab 2022-05-21 10:26:45 -04:00 committed by GitHub
parent f3e5423677
commit 089246db53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 18 deletions

View File

@ -11730,3 +11730,21 @@ std::map<std::string,std::string> Client::GetMerchantDataBuckets()
return merchant_data_buckets;
}
void Client::Undye()
{
for (uint8 slot = EQ::textures::textureBegin; slot <= EQ::textures::LastTexture; slot++) {
auto inventory_slot = SlotConvert(slot);
auto inst = m_inv.GetItem(inventory_slot);
if (inst) {
inst->SetColor(inst->GetItem()->Color);
database.SaveInventory(CharacterID(), inst, inventory_slot);
}
m_pp.item_tint.Slot[slot].Color = 0;
SendWearChange(slot);
}
database.DeleteCharacterDye(CharacterID());
}

View File

@ -7,21 +7,3 @@ void command_path(Client *c, const Seperator *sep)
}
}
void Client::Undye()
{
for (int cur_slot = EQ::textures::textureBegin; cur_slot <= EQ::textures::LastTexture; cur_slot++) {
uint8 slot2 = SlotConvert(cur_slot);
EQ::ItemInstance *inst = m_inv.GetItem(slot2);
if (inst != nullptr) {
inst->SetColor(inst->GetItem()->Color);
database.SaveInventory(CharacterID(), inst, slot2);
}
m_pp.item_tint.Slot[cur_slot].Color = 0;
SendWearChange(cur_slot);
}
database.DeleteCharacterDye(CharacterID());
}