From 089246db53e368563c3ac36ca8687f8913b0ba46 Mon Sep 17 00:00:00 2001 From: Kinglykrab <89047260+Kinglykrab@users.noreply.github.com> Date: Sat, 21 May 2022 10:26:45 -0400 Subject: [PATCH] [Cleanup] Move Client::Undye() to client.cpp from #path Command. (#2188) - Client::Undye() was inside the #path command file. --- zone/client.cpp | 18 ++++++++++++++++++ zone/gm_commands/path.cpp | 18 ------------------ 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/zone/client.cpp b/zone/client.cpp index 16c28e20b..a7f0f0cbd 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -11730,3 +11730,21 @@ std::map 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()); +} \ No newline at end of file diff --git a/zone/gm_commands/path.cpp b/zone/gm_commands/path.cpp index 80207e07c..79d33c3cd 100755 --- a/zone/gm_commands/path.cpp +++ b/zone/gm_commands/path.cpp @@ -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()); -} -