summaryrefslogtreecommitdiff
path: root/src/game-server/monster.cpp
diff options
context:
space:
mode:
authorGuillaume Melquiond <guillaume.melquiond@gmail.com>2007-07-07 16:50:47 +0000
committerGuillaume Melquiond <guillaume.melquiond@gmail.com>2007-07-07 16:50:47 +0000
commit04e694b067a21dee8e13368c17d1815cc0624ce4 (patch)
treea57ab98d76040838fa369e6823544baeb19d1bbc /src/game-server/monster.cpp
parent60b4a57bdfe664a6729b3573a6a614621b6c2b2c (diff)
downloadmanaserv-04e694b067a21dee8e13368c17d1815cc0624ce4.tar.gz
manaserv-04e694b067a21dee8e13368c17d1815cc0624ce4.tar.bz2
manaserv-04e694b067a21dee8e13368c17d1815cc0624ce4.tar.xz
manaserv-04e694b067a21dee8e13368c17d1815cc0624ce4.zip
Simplified code by using map pointers only, instead of using both map IDs and map pointers.
Diffstat (limited to 'src/game-server/monster.cpp')
-rw-r--r--src/game-server/monster.cpp10
1 files changed, 4 insertions, 6 deletions
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_NODE> 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)
{