ack. It's not even finished yet, but I forgot to remove it before pushing.


On Mon, Mar 24, 2014 at 12:32 AM, Kevin Granade <notifications@github.com>wrote:

> In src/veh_interact.cpp:
>
> > -
> > -            int delta_x = headlight_target.x - (veh->global_x() + gx);
> > -            int delta_y = headlight_target.y - (veh->global_y() + gy);
> > -
> > -            const double PI = 3.14159265358979f;
> > -            int dir = int(atan2(static_cast<float>(delta_y), static_cast<float>(delta_x)) * 180.0 / PI);
> > -            dir -= veh->face.dir();
> > -            while(dir < 0) {
> > -                dir += 360;
> > -            }
> > -            while(dir > 360) {
> > -                dir -= 360;
> > -            }
> > -
> > -            veh->parts[partnum].direction = dir;
> > +            veh->change_headlight_direction(partnum);
>
> Extracting this to a vehicle method is an isolated change you can pull out
> into another PR.
> TODO: apply this to mirrors.
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/CleverRaven/Cataclysm-DDA/pull/6873/files#r10869976>
> .
>



-- 

 - Vidar