From f626e442c7a77191a145825507610d3b1ef40ab3 Mon Sep 17 00:00:00 2001 From: Robert Vollmert Date: Fri, 6 Nov 2009 19:12:55 +0100 Subject: Add actor::set_position. This should be used instead of setting position directly. actor::position could be made "protected" except for the arena's unwind_var(you.position), which is too difficult for me to fix. The reason behind this change is that actors should get their own LOS, whose origin should be synchronized with the actor's position. This change also removes the non-const "coord_def& actor::pos()" (yuk). --- crawl-ref/source/player.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'crawl-ref/source/player.cc') diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index 43b57b5886..abd9b69748 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -7008,12 +7008,12 @@ bool player::is_fiery() const return (false); } -void player::base_moveto(const coord_def &c) +void player::set_position(const coord_def &c) { ASSERT(!crawl_state.arena); const bool real_move = (c != pos()); - position = c; + actor::set_position(c); if (real_move) { @@ -7032,13 +7032,13 @@ void player::moveto(const coord_def &c) clear_trapping_net(); crawl_view.set_player_at(c); - base_moveto(c); + set_position(c); } void player::shiftto(const coord_def &c) { crawl_view.shift_player_to(c); - base_moveto(c); + set_position(c); } void player::reset_prev_move() -- cgit v1.2.3-54-g00ecf