Fix bug in teleport animation

temp_unit.set_location necessary else pre and post teleport animation is played at the same place(arrival).

Closes #3684
This commit is contained in:
newfrenchy83 2018-11-03 10:34:31 +01:00 committed by Gregory A Lundberg
parent d0575affb4
commit 73a331b952
No known key found for this signature in database
GPG key ID: 149484078AE8AE9E

View file

@ -80,6 +80,7 @@ void teleport_unit_between(const map_location& a, const map_location& b, unit& t
const bool a_visible = temp_unit.is_visible_to_team(a, viewing_team, false);
const bool b_visible = temp_unit.is_visible_to_team(b, viewing_team, false);
temp_unit.set_location(a);
if ( a_visible ) { // teleport
disp.invalidate(a);
temp_unit.set_facing(a.get_relative_dir(b));
@ -93,6 +94,7 @@ void teleport_unit_between(const map_location& a, const map_location& b, unit& t
animator.wait_for_end();
}
temp_unit.set_location(b);
if ( b_visible ) { // teleport
disp.invalidate(b);
temp_unit.set_facing(a.get_relative_dir(b));