summaryrefslogtreecommitdiffstats
path: root/src/Section.cpp
diff options
context:
space:
mode:
authorLaG1924 <12997935+LaG1924@users.noreply.github.com>2020-07-27 06:05:53 +0200
committerLaG1924 <12997935+LaG1924@users.noreply.github.com>2020-07-27 06:05:53 +0200
commitd899b21504c02cae99eb3688e561cf9bad4120c4 (patch)
treebfa380e1b81ab848766becff8322e783e4dcde1a /src/Section.cpp
parentMerge pull request #40 from LaG1924/lua-scripting (diff)
downloadAltCraft-d899b21504c02cae99eb3688e561cf9bad4120c4.tar
AltCraft-d899b21504c02cae99eb3688e561cf9bad4120c4.tar.gz
AltCraft-d899b21504c02cae99eb3688e561cf9bad4120c4.tar.bz2
AltCraft-d899b21504c02cae99eb3688e561cf9bad4120c4.tar.lz
AltCraft-d899b21504c02cae99eb3688e561cf9bad4120c4.tar.xz
AltCraft-d899b21504c02cae99eb3688e561cf9bad4120c4.tar.zst
AltCraft-d899b21504c02cae99eb3688e561cf9bad4120c4.zip
Diffstat (limited to 'src/Section.cpp')
-rw-r--r--src/Section.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Section.cpp b/src/Section.cpp
index 29a6a0e..4a15c58 100644
--- a/src/Section.cpp
+++ b/src/Section.cpp
@@ -42,7 +42,10 @@ Section::Section(Vector pos, unsigned char bitsPerBlock, std::vector<unsigned sh
this->block = std::move(blockData);
this->palette = std::move(palette);
std::copy(lightData.begin(), lightData.end(), light);
- std::copy(skyData.begin(), skyData.end(), sky);
+ if (!skyData.empty())
+ std::copy(skyData.begin(), skyData.end(), sky);
+ else
+ memset(sky, 0, sizeof(sky));
hash = -1;
CalculateHash();