CleverRaven/Cataclysm-DDA — pull request #5096 by BevapDin (2013-12-16 12:39:11+00:00)
Title: fix usage of vehicle::part_with_feature

Because `part_with_feature` returns an index (or -1) not a boolean and using it as such will nearly always be interpreted as true (any value != 0 becomes true, so even if the function returns -1).

In `map::trans` it prevents the turrets in the armored car from firing at anything not adjacent - the spikes in front and back of the car count as not transparent (`part_with_feature` returns -1, transformed to boolean is true, which leaves tertr at false). Also `part_with_feature` already checks that the part is not destroyed and the code checked the wrong part (vpart) anyway instead of the part with the OPAQUE flag.

Also once you activate the recharge station, it would charge items on *every* cargo tile (as `part_with_feature` returns -1 but this becomes true) and even if the charge station is removed form the car.

Compare to this previous version 4d6739d40f414e3f1a964d3c8ac17c17534d26bb