Removing the const from the function just makes it not match the existing virtual function so it isn't called from base class pointers.
That means Mob::SendWearChange can't call your new function which is where it seems the actual work of changing the colors happens.
You said the ID you have at the time FillSpawnStruct is called isn't the same ID that the bot has once it is spawned? Have you considered using GetBotIDByBotName to look it up inside your new Bot::GetEquipmentColor function?
I'm also a little confused why the part where you are setting the slotid is inside a while loop. In the best case where a valid material slot is passed the while loop has no effect. If for whatever reason an invalid material slot is passed it's an endless loop. You should probably replace all of that with Inventory::CalcSlotFromMaterial() anyway.
|