Don't pocket water while underwater

This should fix issue #7797
Good points. I will update the code when I get home. Some requirements are
that it works for both infinite and finite water sources
On Jun 28, 2014 6:05 PM, "BevapDin" <notifications@github.com> wrote:

> In src/player.cpp:
>
> > @@ -7418,6 +7418,31 @@ hint_rating player::rate_action_eat(item *it)
> >   return HINT_CANT;
> >  }
> >
> > +//Returns the amount of charges that were consumed byt he player
> > +int player::drink_from_hands(item& water) {
> > +    int charges = 0;
> > +    if (query_yn(_("Drink from your hands?")))
> > +        {
> > +            // Create a dose of water no greater than the amount of water remaining.
> > +            item water_temp("water", 0);
>
> Why do you create a copy of the perfectly good water item (the parameter
> of that function) here? Btw. This will magically transform salt water (from
> iexamine::swater_source) to normal water. If you need this copy, why not
> use the copy constructor: item water_temp(water);, it will copy *all*
> relevant properties of the item? Most likely you don't need the copy at
> all, because inventory::push_back creates its own copy anyway.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/CleverRaven/Cataclysm-DDA/pull/8074/files#r14326518>.
>