CleverRaven/Cataclysm-DDA — pull request #7540 by BevapDin (2014-05-05 09:22:57+00:00)
Title: Fix for "First Aid Kit target error"

Fixes #6705 - reproduce:

Get a bleed wound to the left arm. Make sure the other arm is completely healthy and has no diseases. Than try to apply the first aid kit again.

It shows both arms, the undamaged one is still shown.

The function that displays the body parts to be selected for healing contains this:
```
if(p->hp_cur[hp_arm_r] < p->hp_max[hp_arm_r] ||
(p->has_disease("infected", bp_arms)) ||
(p->has_disease("bite", bp_arms)) ||
(p->has_disease("bleed", bp_arms)) || force) {
color = g->limb_color(p, bp_arms, 1, bleed, bite, infect);
if (color != c_ltgray || normal_bonus != 0) {
mvwprintz(hp_window, 5, 1, color, _("4: Right Arm"));
}
}
```
This checks if the body part has a certain disease, but this check works on *both* sides (the third parameter for `player::has_disease` defaults to -1, which means either side can have the disease).
So `(p->has_disease("bleed", bp_arms))` is true if either (left or right) arm is bleeding.

I added the side indicator to the `has_disease` where appropriate.

The health-bar calculation has been replace with a call to `get_HP_Bar` (already used for the sidebar).

Another bug fix: the user can no longer enter any body part number, only those that are actually show. Previously you could enter the number and the med item would be used even when the selected body part was completely fine. Now entering the number of a body part that is not show results in `num_hp_parts` which cancels the med usage. This also fixes a memory leak when the user leaves the input loop via escape key.