Skip to content

Commit

Permalink
Main: ScriptTranslator - do not assert on empty material names
Browse files Browse the repository at this point in the history
  • Loading branch information
paroj committed May 19, 2024
1 parent ca67f2a commit 61e6003
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 0 additions & 1 deletion OgreMain/src/OgreBuiltinScriptTranslators.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ namespace Ogre{
class MaterialTranslator : public ScriptTranslator
{
protected:
Material *mMaterial;
Ogre::AliasTextureNamePairList mTextureAliases;
public:
MaterialTranslator();
Expand Down
6 changes: 5 additions & 1 deletion OgreMain/src/OgreScriptTranslator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1025,15 +1025,19 @@ namespace Ogre{
* MaterialTranslator
*************************************************************************/
MaterialTranslator::MaterialTranslator()
:mMaterial(0)
{
}
//-------------------------------------------------------------------------
void MaterialTranslator::translate(ScriptCompiler *compiler, const AbstractNodePtr &node)
{
ObjectAbstractNode *obj = static_cast<ObjectAbstractNode*>(node.get());
if(obj->name.empty())
{
compiler->addError(ScriptCompiler::CE_OBJECTNAMEEXPECTED, obj->file, obj->line);
return;
}

Material* mMaterial = 0;

// Create a material with the given name
CreateMaterialScriptCompilerEvent evt(node->file, obj->name, compiler->getResourceGroup());
Expand Down

0 comments on commit 61e6003

Please sign in to comment.