From 7bc4a6671cd897487ffbc425a6128ebdce0b26e7 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Fri, 16 Jun 2023 10:16:37 +0200 Subject: [PATCH] Update LWSLoader.cpp --- code/AssetLib/LWS/LWSLoader.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/AssetLib/LWS/LWSLoader.cpp b/code/AssetLib/LWS/LWSLoader.cpp index f8235c01c..507b6709e 100644 --- a/code/AssetLib/LWS/LWSLoader.cpp +++ b/code/AssetLib/LWS/LWSLoader.cpp @@ -863,10 +863,13 @@ void LWSImporter::InternReadFile(const std::string &pFile, aiScene *pScene, IOSy master->mCameras = new aiCamera *[master->mNumCameras = num_camera]; } aiCamera **cams = master->mCameras; + master->mCameras = nullptr; + if (num_light) { master->mLights = new aiLight *[master->mNumLights = num_light]; } aiLight **lights = master->mLights; + master->mLights = nullptr; std::vector attach; std::vector anims; @@ -888,6 +891,7 @@ void LWSImporter::InternReadFile(const std::string &pFile, aiScene *pScene, IOSy if (anims.size()) { master->mAnimations = new aiAnimation *[master->mNumAnimations = 1]; aiAnimation *anim = master->mAnimations[0] = new aiAnimation(); + master->mAnimations[0] = nullptr; anim->mName.Set("LWSMasterAnim"); // LWS uses seconds as time units, but we convert to frames