Fixed crash.
This commit is contained in:
parent
61e2d5ea8c
commit
b526a291d7
1 changed files with 2 additions and 1 deletions
|
@ -334,7 +334,8 @@ Generator::findClosestFloor(const Vector2i& start) const {
|
||||||
Vector2i current = std::min_element(open.begin(), open.end())->first;
|
Vector2i current = std::min_element(open.begin(), open.end())->first;
|
||||||
open.erase(current);
|
open.erase(current);
|
||||||
closed.insert(current);
|
closed.insert(current);
|
||||||
if (mTiles.at(current.x).at(current.y) == Tile::Type::FLOOR)
|
if (mTiles.count(current.x) != 0 && mTiles.at(current.x).count(current.y) != 0 &&
|
||||||
|
mTiles.at(current.x).at(current.y) == Tile::Type::FLOOR)
|
||||||
return current;
|
return current;
|
||||||
else {
|
else {
|
||||||
insertNew(Vector2i(current.x + 1, current.y));
|
insertNew(Vector2i(current.x + 1, current.y));
|
||||||
|
|
Reference in a new issue