diff options
author | Elias Fleckenstein <54945686+EliasFleckenstein03@users.noreply.github.com> | 2020-11-04 16:57:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-04 16:57:47 +0100 |
commit | 3e16c3a78fff61c20e63ba730d15e94e3bb877b4 (patch) | |
tree | c070350db219f2c4241d22bc31949685c7b42fe9 /src/mapsector.cpp | |
parent | 5d9ae5a91c544fc7fbd475decf47cef7e09ef8fc (diff) | |
parent | 6ccb5835ff55d85156be91473c598eca9d6cb9a6 (diff) | |
download | dragonfireclient-3e16c3a78fff61c20e63ba730d15e94e3bb877b4.tar.xz |
Merge branch 'master' into master
Diffstat (limited to 'src/mapsector.cpp')
-rw-r--r-- | src/mapsector.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/mapsector.cpp b/src/mapsector.cpp index b004b9013..3eefa5410 100644 --- a/src/mapsector.cpp +++ b/src/mapsector.cpp @@ -22,8 +22,10 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "mapblock.h" #include "serialization.h" -MapSector::MapSector(Map *parent, v2s16 pos, IGameDef *gamedef) : - m_parent(parent), m_pos(pos), m_gamedef(gamedef) +MapSector::MapSector(Map *parent, v2s16 pos, IGameDef *gamedef): + m_parent(parent), + m_pos(pos), + m_gamedef(gamedef) { } @@ -46,7 +48,7 @@ void MapSector::deleteBlocks() m_blocks.clear(); } -MapBlock *MapSector::getBlockBuffered(s16 y) +MapBlock * MapSector::getBlockBuffered(s16 y) { MapBlock *block; @@ -55,7 +57,7 @@ MapBlock *MapSector::getBlockBuffered(s16 y) } // If block doesn't exist, return NULL - std::unordered_map<s16, MapBlock *>::const_iterator n = m_blocks.find(y); + std::unordered_map<s16, MapBlock*>::const_iterator n = m_blocks.find(y); block = (n != m_blocks.end() ? n->second : nullptr); // Cache the last result @@ -65,14 +67,14 @@ MapBlock *MapSector::getBlockBuffered(s16 y) return block; } -MapBlock *MapSector::getBlockNoCreateNoEx(s16 y) +MapBlock * MapSector::getBlockNoCreateNoEx(s16 y) { return getBlockBuffered(y); } -MapBlock *MapSector::createBlankBlockNoInsert(s16 y) +MapBlock * MapSector::createBlankBlockNoInsert(s16 y) { - assert(getBlockBuffered(y) == NULL); // Pre-condition + assert(getBlockBuffered(y) == NULL); // Pre-condition v3s16 blockpos_map(m_pos.X, y, m_pos.Y); @@ -81,7 +83,7 @@ MapBlock *MapSector::createBlankBlockNoInsert(s16 y) return block; } -MapBlock *MapSector::createBlankBlock(s16 y) +MapBlock * MapSector::createBlankBlock(s16 y) { MapBlock *block = createBlankBlockNoInsert(y); |