summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/terrain.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/terrain.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/terrain.cc')
-rw-r--r--crawl-ref/source/terrain.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/crawl-ref/source/terrain.cc b/crawl-ref/source/terrain.cc
index e7f9458985..75b60c41c0 100644
--- a/crawl-ref/source/terrain.cc
+++ b/crawl-ref/source/terrain.cc
@@ -959,9 +959,9 @@ bool swap_features(const coord_def &pos1, const coord_def &pos2,
mgrd(pos2) = m1;
if (monster_at(pos1))
- menv[mgrd(pos1)].position = pos1;
+ menv[mgrd(pos1)].set_position(pos1);
if (monster_at(pos2))
- menv[mgrd(pos2)].position = pos2;
+ menv[mgrd(pos2)].set_position(pos2);
// Swap clouds.
move_cloud(env.cgrid(pos1), temp);
@@ -970,12 +970,12 @@ bool swap_features(const coord_def &pos1, const coord_def &pos2,
if (pos1 == you.pos())
{
- you.position = pos2;
+ you.set_position(pos2);
viewwindow(true, false);
}
else if (pos2 == you.pos())
{
- you.position = pos1;
+ you.set_position(pos1);
viewwindow(true, false);
}