summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/monstuff.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/monstuff.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/monstuff.cc')
-rw-r--r--crawl-ref/source/monstuff.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index 15c3bfd9ee..9c2b3de63f 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -1143,7 +1143,7 @@ static bool _spore_goes_pop(monsters *monster, killer_type killer,
// used to be, so make sure that mgrd() doesn't get cleared a second
// time (causing the new monster to become floating) when
// monster->reset() is called.
- monster->pos().reset();
+ monster->set_position(coord_def(0,0));
// Exploding kills the monster a bit earlier than normal.
monster->hit_points = -16;
@@ -3764,7 +3764,7 @@ int clone_mons(const monsters* orig, bool quiet, bool* obvious,
monsters &mon(menv[midx]);
mon = *orig;
- mon.position = pos;
+ mon.set_position(pos);
mgrd(pos) = midx;
// Duplicate objects, or unequip them if they can't be duplicated.