diff options
author | Elias Fleckenstein <54945686+EliasFleckenstein03@users.noreply.github.com> | 2020-11-04 16:44:42 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-04 16:44:42 +0100 |
commit | 5d9ae5a91c544fc7fbd475decf47cef7e09ef8fc (patch) | |
tree | c980d614fec4a5495798be3e79e033229062c3cd /src/mapsector.cpp | |
parent | 28f6a79706b088c37268a59d90878220dc4ef9c7 (diff) | |
parent | 3af10766fd2b58b068e970266724d7eb10e9316b (diff) | |
download | dragonfireclient-5d9ae5a91c544fc7fbd475decf47cef7e09ef8fc.tar.xz |
Merge branch 'master' into master
Diffstat (limited to 'src/mapsector.cpp')
-rw-r--r-- | src/mapsector.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/mapsector.cpp b/src/mapsector.cpp index 3eefa5410..b004b9013 100644 --- a/src/mapsector.cpp +++ b/src/mapsector.cpp @@ -22,10 +22,8 @@ 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) { } @@ -48,7 +46,7 @@ void MapSector::deleteBlocks() m_blocks.clear(); } -MapBlock * MapSector::getBlockBuffered(s16 y) +MapBlock *MapSector::getBlockBuffered(s16 y) { MapBlock *block; @@ -57,7 +55,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 @@ -67,14 +65,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); @@ -83,7 +81,7 @@ MapBlock * MapSector::createBlankBlockNoInsert(s16 y) return block; } -MapBlock * MapSector::createBlankBlock(s16 y) +MapBlock *MapSector::createBlankBlock(s16 y) { MapBlock *block = createBlankBlockNoInsert(y); |