diff options
author | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2017-09-23 17:55:08 +0200 |
---|---|---|
committer | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2018-01-13 03:39:32 +0100 |
commit | 437cf879808fb68a79e7f8325615737f86f434be (patch) | |
tree | db9dcb8c02606dc8bfc7478e058291b6cec076cf /src/Section.cpp | |
parent | 2017-09-20 (diff) | |
download | AltCraft-437cf879808fb68a79e7f8325615737f86f434be.tar AltCraft-437cf879808fb68a79e7f8325615737f86f434be.tar.gz AltCraft-437cf879808fb68a79e7f8325615737f86f434be.tar.bz2 AltCraft-437cf879808fb68a79e7f8325615737f86f434be.tar.lz AltCraft-437cf879808fb68a79e7f8325615737f86f434be.tar.xz AltCraft-437cf879808fb68a79e7f8325615737f86f434be.tar.zst AltCraft-437cf879808fb68a79e7f8325615737f86f434be.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Section.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/Section.cpp b/src/Section.cpp index 67dde70..e6b6d93 100644 --- a/src/Section.cpp +++ b/src/Section.cpp @@ -69,9 +69,11 @@ BlockId Section::GetBlockId(Vector pos) const { if (block.empty()) return BlockId{ 0,0 }; - auto iter = overrideList.find(pos); - if (iter != overrideList.end()) - return iter->second; + if (!overrideList.empty()) { + auto iter = overrideList.find(pos); + if (iter != overrideList.end()) + return iter->second; + } int value; @@ -104,7 +106,7 @@ BlockId Section::GetBlockId(Vector pos) const { BlockId blockId; blockId.id = value >> 4; - blockId.state = value & 0xF; + blockId.state = value & 0xF; return blockId; } |