diff options
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; } } } |
