Just from a glance, it looks like act->name is storing the position of the item to reload (as a string for some reason), and then ss >> reloadable_pos converts this string into an int, then it is picking the item at that position from the players inventory with &p->i_at(reloadable_pos).