summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/player.cc
diff options
context:
space:
mode:
authorRobert Vollmert <rvollmert@gmx.net>2009-11-06 19:12:55 +0100
committerRobert Vollmert <rvollmert@gmx.net>2009-11-06 19:16:20 +0100
commitf626e442c7a77191a145825507610d3b1ef40ab3 (patch)
treeebdcf660d3c1dd058c19419cb5983568733d4b04 /crawl-ref/source/player.cc
parent4412160c9f7d6410f7974e6daf1027716547cceb (diff)
downloadcrawl-ref-f626e442c7a77191a145825507610d3b1ef40ab3.tar.gz
crawl-ref-f626e442c7a77191a145825507610d3b1ef40ab3.zip
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).
Diffstat (limited to 'crawl-ref/source/player.cc')
-rw-r--r--crawl-ref/source/player.cc8
1 files changed, 4 insertions, 4 deletions
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()