function inv_run_slot_callback ( Bag *bag, var slot_id )
{
if ( !on_click_callback_function_ptr )
return 0;
int i = 0;
for ( ; i<bag->_slot_count; i++ )
{
Slot *slot = bag->slots[i];
if ( slot->id != slot_id )
continue;
Item *item = slot->item;
if ( !item )
return 0;
on_click_callback_function_ptr ( INV_ITEM_PLACED, bag->id, slot->id, item->id, NULL );
return 1;
}
return 0;
}