As far as I understand, there's a small bug in this command when using 'hide valid internal' flag. It doesn't hide Animals in Buy lists.
I think, a little check should be add near line 300 to xmlfind.cs
CODE |
if (m.Map != Map.Internal || m.Account != null || ( m is IMount && ((IMount)m).Rider != null) || (m is BaseCreature && ((BaseCreature)m).IsStabled)) return true;
|
Should become
CODE |
if (m.Map != Map.Internal || m.Account != null || ( m is IMount && ((IMount)m).Rider != null) || (m is BaseCreature && ((BaseCreature)m).IsStabled) || (m.GetType().DeclaringType == typeof(AnimalBuyInfo)) ) return true;
|
Or some additionals checks should be added?
checking for valid vendor mobiles, unfortunately, turns out not to be as straightforward as checking for valid vendor items.
I have not yet found a way to do this, but I'll keep working on it.
This simple check doesn't help in case of default animal vendors?
afraid not. Actually, even that check is kind of a hack.
The problem is that vendor items and mobiles are maintained in a container called the DisplayCache. Unfortunately, the devs made that class private within the GenericBuyInfo class, so it cannot be seen outside of that class.
The DeclaringType check allows me to indirectly test for it by checking not for the DisplayCache itself, but for things like the DisplayCache that are declared within the GenericBuyInfo class.
This allows me to indirectly check for that DisplayCache container and flag it as valid, and by default any items within a valid container are also protected.
Now, you cant put mobiles inside of a container, so they are maintained in a list that is within the DisplayCache container. Because this is not a standard thing, they dont get protected even if the container is valid so I need to get to that list and check it explicitly.
In order for me to check that list, I need to have access to that container, and I cant get to it the way that it is currently defined.
If DisplayCache were made public, then there would be no problem.