viewing paste Unknown #6079 | Text

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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
void guild_bound_chk(struct map_session_data* sd)
{
    int idxlist[MAX_INVENTORY];
    int i, j=0;
 
    for(i=0;i<MAX_INVENTORY;i++) {
        if(sd->status.inventory[i].nameid > 0 && sd->status.inventory[i].amount > 0 && sd->status.inventory[i].bound == 2) {
            idxlist[j] = i;
            j++;
        }
    }
    if(j) {
        struct guild_storage* stor = guild2storage(sd->status.guild_id);
        for(i=0;i<j;i++) {
            guild_storage_additem(sd,stor,&sd->status.inventory[idxlist[i]],sd->status.inventory[idxlist[i]].amount);
            pc_delitem(sd,idxlist[i],sd->status.inventory[idxlist[i]].amount,0,4,LOG_TYPE_GSTORAGE);
        }
        storage_guild_storageclose(sd);
    }
}
 
/*==========================================
 * Player request leaving a given guild_id
 *----------------------------------------*/
int guild_leave(struct map_session_data* sd, int guild_id, int account_id, int char_id, const char* mes)
{
    struct guild *g;
 
    nullpo_ret(sd);
 
    g = sd->guild;
 
    if(g==NULL)
        return 0;
 
    if(sd->status.account_id!=account_id ||
        sd->status.char_id!=char_id || sd->status.guild_id!=guild_id ||
        ((agit_flag || agit2_flag) && map[sd->bl.m].flag.gvg_castle))
        return 0;
 
    //Guild bound item check
    guild_bound_chk(sd);
 
    intif_guild_leave(sd->status.guild_id, sd->status.account_id, sd->status.char_id,0,mes);
    return 0;
}
Viewed 572 times, submitted by Guest.