Find where Pickaxe is stored, and do the same thing.it any lumberjacking tool
entry.Add( new ToolEntry( typeof( Hatchet ), "Lumberjacking", 0, 30, -5, 0 ) );
entry.Add( new ToolEntry( typeof( Hatchet ), new Type[]{ typeof( Axe ), typeof( Hatchet) }, "Lumberjacking", 0, 30, -5, 0 ) );
typeof( Hatchet )
new Type[]{ typeof( Axe ), typeof( Hatchet) }
public class Pickaxe : BaseAxe, IUsesRemaining
public class Hatchet : BaseAxe
Could u give an example?if you can"t find it.. you can always just go crazy with null checks..
make sure the store that you're calling the FillFromBackpack( from, false ) isn't null, make sure from isn't null, make sure the from has a backpack.. etc.
Yes, looking at the CrashLog.txt you posted a few posts up I've gone in and altered my MasterKey class's FindConsumableEntry( Type[], int ) method to the following:Could u give an example?
public StoreEntry FindConsumableEntry( Type[] types, int amount )
{
if( _Stores == null ) return null; // obvious null check to avoid attempting to iterate through a null collection
foreach( ItemStore store in _Stores )
{
if( store == null )
continue; // "continue" will skip the current element and continue the foreach loop, "break" would end the entire foreach loop, and "return" would end the entire method call.
//find a match in this key's store
int index = StoreEntry.IndexOfType( store.StoreEntries, types, true );
//check if there was a match, and there is a sufficient amount
if( index > -1 )
{
StoreEntry entry = store.StoreEntries[index];
if( entry != null && entry.Amount >= amount ) // breaking this section up like i've done will ensure that you're not trying to access the property "Amount" if "entry" is null
{
//return a reference to this
return store.StoreEntries[index];
}
}
}
//nothing suitable found, return null
return null;
}