Skip to content

Commit

Permalink
#5721: Return the default material if the active one is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
codereader committed Aug 22, 2021
1 parent be38aeb commit 77aa7eb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion radiantcore/model/StaticModelSurface.cpp
Expand Up @@ -248,7 +248,7 @@ void StaticModelSurface::setDefaultMaterial(const std::string& defaultMaterial)

const std::string& StaticModelSurface::getActiveMaterial() const
{
return _activeMaterial;
return !_activeMaterial.empty() ? _activeMaterial : _defaultMaterial;
}

void StaticModelSurface::setActiveMaterial(const std::string& activeMaterial)
Expand Down
2 changes: 1 addition & 1 deletion radiantcore/model/md5/MD5Surface.cpp
Expand Up @@ -269,7 +269,7 @@ const std::string& MD5Surface::getDefaultMaterial() const

const std::string& MD5Surface::getActiveMaterial() const
{
return _activeMaterial;
return !_activeMaterial.empty() ? _activeMaterial : _originalShaderName;
}

void MD5Surface::setActiveMaterial(const std::string& activeMaterial)
Expand Down

0 comments on commit 77aa7eb

Please sign in to comment.