summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/monster.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/monster.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/monster.cc')
-rw-r--r--crawl-ref/source/monster.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/crawl-ref/source/monster.cc b/crawl-ref/source/monster.cc
index 6c584297b3..28f44c2c7b 100644
--- a/crawl-ref/source/monster.cc
+++ b/crawl-ref/source/monster.cc
@@ -2630,7 +2630,7 @@ void monsters::moveto(const coord_def& c)
if (c != pos() && in_bounds(pos()))
mons_clear_trapping_net(this);
- position = c;
+ set_position(c);
}
bool monsters::fumbles_attack(bool verbose)
@@ -4845,7 +4845,7 @@ void monsters::apply_enchantment(const mon_enchant &me)
// If you are no longer dying, you must be dead.
if (decay_enchantment(me))
{
- if (::see_cell(this->position))
+ if (::see_cell(position))
{
mprf("A nearby %s withers and dies.",
this->name(DESC_PLAIN, false).c_str());