Functions in activity_handlers::reload_finish

item *reloadable = nullptr; { int reloadable_pos; std::stringstream ss(act->name); ss >> reloadable_pos; reloadable = &p->i_at(reloadable_pos); }
From the code that comes after this I’m pretty sure it gets the item that you’re trying to reload and assigns it to reloadable.

What do act->name and &p->i_at(reloadable_pos) do?

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).

What do you mean by position?

Where in the player’s internal code representing the inventory the item is located. It really should be using the position parameter according to