X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Floader%2FLoader.cpp;h=1e0050dbc022a64c1d7896428caad0b152dac2f0;hb=7b3710c47f24e64e0d01378a4564730bcb2f6ef2;hp=9c8739aabee00191584852973971f203fc8afa5e;hpb=5f9a1893c0db8f53889a390e4c4b95d57abd4384;p=l2e.git diff --git a/src/loader/Loader.cpp b/src/loader/Loader.cpp index 9c8739a..1e0050d 100644 --- a/src/loader/Loader.cpp +++ b/src/loader/Loader.cpp @@ -120,13 +120,18 @@ void Loader::LoadObject(char *src, char *object, const TypeDescription &td) { void Loader::LoadArrays(char *src, Array *begin, Array *end) { for (Array *i = begin; i < end; i = i->Next()) { - if (!i->ref) { - continue; - } - for (char *j = i->Data(), *end = i->Data() + i->size; - j < end; j += sizeof(void *)) { - *reinterpret_cast(j) = - src + *reinterpret_cast(j); + if (i->ref) { + for (char *j = i->Data(), *end = i->Data() + i->size; + j < end; j += sizeof(void *)) { + *reinterpret_cast(j) = + src + *reinterpret_cast(j); + } + } else { + const TypeDescription &td = TypeDescription::Get(i->typeId); + for (char *j = i->Data(), *end = i->Data() + i->size; + j < end; j += td.Size()) { + LoadObject(src, j, td); + } } } }