diff options
| author | Philipp Sehmisch <tmw@crushnet.org> | 2008-03-13 07:29:01 +0000 |
|---|---|---|
| committer | Philipp Sehmisch <tmw@crushnet.org> | 2008-03-13 07:29:01 +0000 |
| commit | efe4ef65bedbaa66e35f3a4354f7422c313ce624 (patch) | |
| tree | c1259e6a60e80ee5b8ba97c44f9223071aba4df7 /src/game-server/spawnarea.cpp | |
| parent | 344fe375ff6e7db425da6ca266e02ea93dd7cc4d (diff) | |
| download | manaserv-efe4ef65bedbaa66e35f3a4354f7422c313ce624.tar.gz manaserv-efe4ef65bedbaa66e35f3a4354f7422c313ce624.tar.xz manaserv-efe4ef65bedbaa66e35f3a4354f7422c313ce624.zip | |
Implemented dynamic and selective pathblocking. Monsters are blocked by player characters and other monsters, player characters only by monsters.
Diffstat (limited to 'src/game-server/spawnarea.cpp')
| -rw-r--r-- | src/game-server/spawnarea.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/game-server/spawnarea.cpp b/src/game-server/spawnarea.cpp index abc1657..3054a0a 100644 --- a/src/game-server/spawnarea.cpp +++ b/src/game-server/spawnarea.cpp @@ -79,15 +79,16 @@ SpawnArea::update() height = realMap->getHeight() * 32; } + Being *being = new Monster(mSpecy); + do { position = Point(x + rand() % width, y + rand() % height); c--; - } while (!realMap->getWalk(position.x / 32, position.y / 32) && c); + } while (!realMap->getWalk(position.x / 32, position.y / 32, being->getWalkMask()) && c); if (c) { - Being *being = new Monster(mSpecy); being->addListener(&mSpawnedListener); being->setMap(map); @@ -103,6 +104,7 @@ SpawnArea::update() << mSpecy->getType() << " on map " << map->getName() << " (" << x << ',' << y << ',' << width << ',' << height << ')'); + delete being; } } } |
