From 5408a5eade590fb4604197e6395c874bcc7ca7d0 Mon Sep 17 00:00:00 2001 From: Azaezel Date: Tue, 24 Oct 2017 19:15:54 -0500 Subject: [PATCH] allows arbitrary material name string replacement, rather than forcing folks to start with base. ie: an entry of skin = "blue; area=fire"; would replace base_area_grid with blue_fire_grid as the used material --- Engine/source/ts/tsShapeInstance.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Engine/source/ts/tsShapeInstance.cpp b/Engine/source/ts/tsShapeInstance.cpp index 98d6b39ea..7010371bc 100644 --- a/Engine/source/ts/tsShapeInstance.cpp +++ b/Engine/source/ts/tsShapeInstance.cpp @@ -307,12 +307,9 @@ void TSShapeInstance::reSkin( String newBaseName, String oldBaseName ) { // Try changing base const String &pName = materialNames[i]; - if ( pName.compare( oldBaseName, oldBaseNameLength, String::NoCase ) == 0 ) - { - String newName( pName ); - newName.replace( 0, oldBaseNameLength, newBaseName ); - pMatList->renameMaterial( i, newName ); - } + String newName( pName ); + newName.replace( oldBaseName, newBaseName ); + pMatList->renameMaterial( i, newName ); } // Initialize the material instances