I'm trying to override public override void VendorBuy in the vendor npc script. I can override it in BaseVendor and it works. However when I tried to override it in the NPC script it failed. Here is the override code as well as the error. Note, it DOES compile, the error appears in the console after i try adding the vendor.

Any suggestions on working around this would be great. Also, without the override in the NPC script, they do add successfully.

Code:
        public override void VendorBuy(Mobile from)
        {
            RaceWarFactionsXML RaceXML = (RaceWarFactionsXML)XmlAttach.FindAttachment(from, typeof(RaceWarFactionsXML));
            if (RaceXML != null)
            {
                if (this is UndineRaceVendor)
                {
                    if (RaceXML.SubRaceXML != SubRaceXML.Undine)
                    {
                        Say(true, "I refuse to help our sworn enemy...");
                        return;
                    }
                }   
            }
        }

Error:
Code:
17:33:30 System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at Server.Items.RaceChest.OnEquip(Mobile from)
   at Server.Mobile.EquipItem(Item item)
   at Server.Mobiles.UndineRaceVendor.InitOutfit()
   at Server.Mobiles.BaseVendor..ctor(String title)
   at Server.Mobiles.UndineRaceVendor..ctor()
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Server.Commands.Add.Build(Mobile from, ConstructorInfo ctor, Object[] values, String[,] props, PropertyInfo[] realProps, Boolean& sendError)
   at Server.Commands.Add.Build(Mobile from, Point3D start, Point3D end, ConstructorInfo ctor, Object[] values, String[,] props, PropertyInfo[] realProps, List`1 packs, Boolean outline, Boolean mapAvg)
 
Back