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/monster.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crawl-ref/source/monster.cc') 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()); -- cgit v1.2.3-54-g00ecf