Made it so map centers on unit instead of scrolling when a unit moves
This commit is contained in:
parent
caacb6f2a9
commit
2806fffc02
1 changed files with 7 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue