Made it so map centers on unit instead of scrolling when a unit moves

This commit is contained in:
Dave White 2003-09-21 05:29:38 +00:00
parent caacb6f2a9
commit 2806fffc02

View file

@ -1973,6 +1973,9 @@ void display::move_unit_between(const gamemap::location& a,
double xloc = xsrc + xstep*i;
double yloc = ysrc + ystep*i;
double oldxpos = xpos_;
double oldypos = ypos_;
if(xloc < side_threshhold) {
scroll(xloc - side_threshhold,0.0);
}
@ -1991,6 +1994,10 @@ void display::move_unit_between(const gamemap::location& a,
(this->y() - side_threshhold)));
}
if(oldxpos != xpos_ || oldypos != ypos_) {
scroll_to_tile(b.x,b.y,WARP);
}
xsrc = get_location_x(a);
ysrc = get_location_y(a);
xdst = get_location_x(b);