Skip to content

Commit

Permalink
Fix bug in teleport animation
Browse files Browse the repository at this point in the history
temp_unit.set_location necessary else pre and post teleport animation is played at the same place(arrival).

Closes #3684
  • Loading branch information
newfrenchy83 authored and GregoryLundberg committed Nov 6, 2018
1 parent d0575af commit 73a331b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/units/udisplay.cpp
Expand Up @@ -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));
Expand All @@ -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));
Expand Down

0 comments on commit 73a331b

Please sign in to comment.