From 04e694b067a21dee8e13368c17d1815cc0624ce4 Mon Sep 17 00:00:00 2001 From: Guillaume Melquiond Date: Sat, 7 Jul 2007 16:50:47 +0000 Subject: Simplified code by using map pointers only, instead of using both map IDs and map pointers. --- src/game-server/monster.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/game-server/monster.cpp') diff --git a/src/game-server/monster.cpp b/src/game-server/monster.cpp index 4881a9b7..be9d6fa1 100644 --- a/src/game-server/monster.cpp +++ b/src/game-server/monster.cpp @@ -92,7 +92,7 @@ void Monster::update() Direction bestAttackDirection = DIRECTION_DOWN; // iterate through objects nearby - for (MovingObjectIterator i(mMap->getAroundCharacterIterator(this, AROUND_AREA)); i; ++i) + for (MovingObjectIterator i(getMap()->getAroundCharacterIterator(this, AROUND_AREA)); i; ++i) { // we only want to attack player characters if ((*i)->getType() != OBJECT_CHARACTER) continue; @@ -185,11 +185,9 @@ int Monster::calculatePositionPriority(Point position, int targetPriority) } std::list path; - path = mMap->getMap()->findPath(thisPos.x / 32, - thisPos.y / 32, - position.x / 32, - position.y / 32, - mAgressionRange); + path = getMap()->getMap()->findPath(thisPos.x / 32, thisPos.y / 32, + position.x / 32, position.y / 32, + mAgressionRange); if (path.empty() || path.size() >= mAgressionRange) { -- cgit v1.2.3-60-g2f50