1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Duplicate Goza's Not Retaining Cloth Hue

Discussion in 'Archived Bug Reports' started by Ce Jayce, Feb 17, 2014.

  1. Ce Jayce
    Offline

    Ce Jayce Member

    Joined:
    Jan 24, 2014
    Messages:
    140
    Likes Received:
    14
    So i've ran into a bug with Goza's - If you craft them with cloth, whatever the colour they don't retain the hue of the cloth.
    However If you craft them with leather they retain the leather hue.
    As per UO Guide:
    Here's the bit of code that deals with it:
    Code (C#):
    1.  
    2.         private static readonly Type[] m_TailorColorables = new Type[]
    3.         {
    4.             typeof(GozaMatEastDeed), typeof(GozaMatSouthDeed),
    5.             typeof(SquareGozaMatEastDeed), typeof(SquareGozaMatSouthDeed),
    6.             typeof(BrocadeGozaMatEastDeed), typeof(BrocadeGozaMatSouthDeed),
    7.             typeof(BrocadeSquareGozaMatEastDeed), typeof(BrocadeSquareGozaMatSouthDeed)
    8.         };
    9.  
    10.         public override bool RetainsColorFrom(CraftItem item, Type type)
    11.         {
    12.             if (type != typeof(Cloth) && type != typeof(UncutCloth))
    13.                 return false;
    14.  
    15.             type = item.ItemType;
    16.  
    17.             bool contains = false;
    18.  
    19.             for (int i = 0; !contains && i < m_TailorColorables.Length; ++i)
    20.                 contains = (m_TailorColorables[i] == type);
    21.  
    22.             return contains;
    23.         }
    From what I understand it's storing material type rather than material hue.

    Any ideas where to head with this one?

    Thanks in advance! :)
     
  2. Kalamus
    Offline

    Kalamus Active Member

    Joined:
    Apr 24, 2013
    Messages:
    282
    Likes Received:
    32
    Nothing wrong with the code bit you posted. I found the problem but I'm not sure how OSI handles this system. The Goza's are currently setup to take the hue of the deed they were created with but when you craft the deed the hue never gets set. If the deed is in fact suppose to be hued too then you can try my fix below. I haven't tested it with anything else so it does need testing.

    Find this code in BaseAddonDeed.cs in the OnCraft method.
    Code (C#):
    1. if (context != null && context.DoNotColor)
    2.     this.Hue = 0;
    Add this else condition to the end of that.
    Code (C#):
    1. else
    2.     this.Hue = resHue;
    This will now color the deed which will code the Goza when placed. Again this needs testing with other deeds as I haven't done any testing with it.
     
    • Like Like x 1
    • Two Thumbs Up Two Thumbs Up x 1
    • Winner Winner x 1
  3. Ce Jayce
    Offline

    Ce Jayce Member

    Joined:
    Jan 24, 2014
    Messages:
    140
    Likes Received:
    14
    Awesome! Thanks for that!
    I'll do some testing and see what else it effects and if they should be able to have hues as per osi etc!

    Thanks again
     
  4. Milva
    Offline

    Admin Moderator

    Joined:
    Mar 3, 2013
    Messages:
    3,637
    Likes Received:
    398
    Nice! This has been a bug for some time now with other's asking about it also :)
     
  5. Ce Jayce
    Offline

    Ce Jayce Member

    Joined:
    Jan 24, 2014
    Messages:
    140
    Likes Received:
    14
    Going back through the forums I realised this was a re-report so my apologies on that one.
    The fix has now been pulled into the repo - Thanks Kalamus!
    https://github.com/ServUO/ServUO/pull/5
    -Ready for the mods to mop this one up!