Ver código fonte

Bugfix: Fix a crash when scene picking an object with a not-yet-loaded material

BearishSun 6 anos atrás
pai
commit
dcfa98ad44
1 arquivos alterados com 1 adições e 1 exclusões
  1. 1 1
      Source/EditorCore/Scene/BsScenePicking.cpp

+ 1 - 1
Source/EditorCore/Scene/BsScenePicking.cpp

@@ -130,7 +130,7 @@ namespace bs
 						SPtr<RasterizerState> rasterizerState = RasterizerState::getDefault();
 						SPtr<RasterizerState> rasterizerState = RasterizerState::getDefault();
 
 
 						HMaterial originalMat = renderable->getMaterial(i);
 						HMaterial originalMat = renderable->getMaterial(i);
-						if (originalMat != nullptr && originalMat->getNumPasses() > 0)
+						if (originalMat.isLoaded() && originalMat->getNumPasses() > 0)
 						{
 						{
 							SPtr<Pass> firstPass = originalMat->getPass(0); // Note: We only ever check the first pass, problem?
 							SPtr<Pass> firstPass = originalMat->getPass(0); // Note: We only ever check the first pass, problem?
 							const auto& pipelineState = firstPass->getGraphicsPipelineState();
 							const auto& pipelineState = firstPass->getGraphicsPipelineState();