viewing paste bound_storage | C

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
/*==========================================
 * Retrieve an item from the storage.
 *------------------------------------------*/
int storage_storageget(struct map_session_data* sd, int index, int amount)
{
    int flag;
 
    if( index < 0 || index >= MAX_STORAGE )
        return 0;
 
    if( sd->status.storage.items[index].nameid <= 0 )
        return 0; //Nothing there
    
    if( amount < 1 || amount > sd->status.storage.items[index].amount )
        return 0;
 
         if (MakeDWord(sd->status.inventory[index].card[2],sd->status.inventory[index].card[3]) != sd->status.char_id) //not your item
             return 0; 
        
    if( (flag = pc_additem(sd,&sd->status.storage.items[index],amount,LOG_TYPE_STORAGE)) == 0 )
        storage_delitem(sd,index,amount);
    else
        clif_additem(sd,0,0,flag);
 
    return 1;
}
Viewed 1237 times, submitted by lighta.