Quote:
Originally Posted by Criimson
EDIT: and I renamed the function GetBotEquipmentColor to keep people from getting it confused with the ones in MoB:: or Client::
EDIT EDIT:
The while statement was for convenience. It will always show == 0 on call and it is only called by the items that show on bots so there is no chance of a loop happening as my code stands now.
|
I am pretty sure you want to override the existing virtual function GetEquipmentColor since it is called from several places that may need to get the proper color.
I still don't get the convenience part of the while loop. It doesn't do anything useful except introduce the possibility for an infinite loop. Even though the existing code may not cause a problem for you today you should always be pragmatic and check your inputs to protect against error.
Anyway, if you replace it with the existing function Inventory::CalcSlotFromMaterial() that does the same thing then your code is cleaner, doesn't rely on magic numbers, and doesn't violate the DRY principle.