diff --git a/Source/levels/crypt.cpp b/Source/levels/crypt.cpp index 356dc3617..489527410 100644 --- a/Source/levels/crypt.cpp +++ b/Source/levels/crypt.cpp @@ -1,6 +1,7 @@ #include "levels/crypt.h" #include "engine/point.hpp" +#include "items.h" #include "levels/drlg_l1.h" namespace devilution { @@ -763,4 +764,19 @@ void CryptSubstitution() } } +void SetCryptSetPieceRoom() +{ + for (int j = dminPosition.y; j < dmaxPosition.y; j++) { + for (int i = dminPosition.x; i < dmaxPosition.x; i++) { + if (dPiece[i][j] == 289) { + UberRow = i; + UberCol = j; + } + if (dPiece[i][j] == 316) { + CornerStone.position = { i, j }; + } + } + } +} + } // namespace devilution diff --git a/Source/levels/crypt.h b/Source/levels/crypt.h index f2c727b9d..9c06f54f2 100644 --- a/Source/levels/crypt.h +++ b/Source/levels/crypt.h @@ -23,5 +23,6 @@ void SetCornerRoom(); void FixCryptDirtTiles(); bool PlaceCryptStairs(lvl_entry entry); void CryptSubstitution(); +void SetCryptSetPieceRoom(); } // namespace devilution diff --git a/Source/levels/drlg_l1.cpp b/Source/levels/drlg_l1.cpp index cbe5eb5f8..a96143bec 100644 --- a/Source/levels/drlg_l1.cpp +++ b/Source/levels/drlg_l1.cpp @@ -1324,17 +1324,7 @@ void CreateL5Dungeon(uint32_t rseed, lvl_entry entry) Pass3(); if (leveltype == DTYPE_CRYPT) { - for (int j = dminPosition.y; j < dmaxPosition.y; j++) { - for (int i = dminPosition.x; i < dmaxPosition.x; i++) { - if (dPiece[i][j] == 289) { - UberRow = i; - UberCol = j; - } - if (dPiece[i][j] == 316) { - CornerStone.position = { i, j }; - } - } - } + SetCryptSetPieceRoom(); } }