Bug - Not A Bug ASH function take_storage ignores quantity in aftercore

Ethelred

Member
In aftercore, the ASH function take_storage pulls all of the item specified instead of only the amount specifed. This has been the behaviour for some time, perhaps always. I first noticed it when I was learning to write scripts and was trying to write a script to pull any missing items for a Pagoda after I freed the king. Then I kind of forgot about it. I recently noticed it again and wrote a little test program to demonstrate it.

Code:
#
# TestItems.ash        Test Inventory Retrieval
#
# Vers. 1.00 3/19/2012 Ethelred
#


void main(  )
{
    
    int ni;
    int ns;
    item it;
    string s;

    print( "Starting test.", "green");    
    for i from 1 to 5299
    {
        it = to_item( i );
        ni = item_amount( it );
        ns = storage_amount( it );
        if(( ni == 0 ) && (ns > 1 ))
        {
            print( "Currently have " + to_string( ni ) + " " + to_string( it ) + ".", "green");    
            take_storage( 1, it );
            ni = item_amount( it );
            print( "Currently have " + to_string( ni ) + " " + to_string( it ) + ".", "green");    
            break;
        }
    }
    print( "Ending test.", "green");    
        
    return;

}

This is by no means a major bug, but it does tend to clutter up my inventory with things I don't want to be there. I'm a packrat and just accumulate a lot of stuff in Hagnk's on the theory that some day it may come in handy. I never empty Hagnk's, so I'd just as soon that stuff I know I only need 1 (or some specific number) of, remains in Hagnk's rather adding to the clutter in my main inventory. Especially on long aftercore stints such as level 30 trophies or telescope upgrades. If this is deemed a feature rather than a bug, perhaps the wiki could be updated to reflect it.

Environment:

MacOS X 10.6.8
Mafia r10811 and earller versions for at least the last year
Java version "1.6.0_26"
 
Last edited:

Veracity

Developer
Staff member
Considering that this is intended behavior (the motivation being that often you will want to get more of the same item later), this is hardly a "bug". In fact, if we change it to suit you, it will result in more server hits for people who like it the way it is now and use it the way it is intended.
 

Ethelred

Member
Considering that this is intended behavior (the motivation being that often you will want to get more of the same item later), this is hardly a "bug". In fact, if we change it to suit you, it will result in more server hits for people who like it the way it is now and use it the way it is intended.

Ok, understood. Howver, your "intended" behavior does not necessarily jibe with my "expected" behavior when I use a function with a quantity parameter. I now understand that the quanity is ignored and will adjust my expectations accordingly. Thanks for your explanation.
 

Veracity

Developer
Staff member
Ok, understood. Howver, your "intended" behavior does not necessarily jibe with my "expected" behavior when I use a function with a quantity parameter. I now understand that the quanity is ignored and will adjust my expectations accordingly. Thanks for your explanation.
Emphasis mine. The "quantity is ignored" outside of Ronin because there are (some) benefits and no downside to doing so.
 
Top