From c171ba1a6a2fd2c9fc6d1fdae42f792bbdafdf0b Mon Sep 17 00:00:00 2001 From: manavortex Date: Thu, 4 Jan 2024 11:14:59 +0100 Subject: [PATCH] File validation: Fixed appearance name check in .app file for dynamic variant suffixes --- Scripts/Wolvenkit_FileValidation.wscript | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Scripts/Wolvenkit_FileValidation.wscript b/Scripts/Wolvenkit_FileValidation.wscript index f25d3d6..d3b013b 100644 --- a/Scripts/Wolvenkit_FileValidation.wscript +++ b/Scripts/Wolvenkit_FileValidation.wscript @@ -566,7 +566,7 @@ function appFile_validatePartsOverride(override, index, appearanceName) { } if (isDynamicAppearance && depotPath && shouldHaveSubstitution(depotPath)) { - Logger.Warning(`${info}: Substitution in depot path not supported.`); + Logger.Warning(`${info}: Substitution for depot path not supported in .app files, use mesh_entity.`); } const appFilePath = pathToCurrentFile; @@ -1163,11 +1163,12 @@ function entFile_validateAppearance(appearance) { const entFilePath = pathToCurrentFile; pathToCurrentFile = appFilePath; - const namesInAppFile = getAppearanceNamesInAppFile(appFilePath, appearanceName) || []; - // if we're being dynamic here, also check for appearance names with suffixes. - if (!namesInAppFile.includes(appearanceNameInAppFile) - && (!isDynamicAppearance || !namesInAppFile.includes(appearanceNameInAppFile.split('&').pop() || '')) + const namesInAppFile = getAppearanceNamesInAppFile(appFilePath, appearanceName) || [] + + const dynamicNamesInAppFile = namesInAppFile.map((name) => name.split('&')[0]); + if (!namesInAppFile.includes(appearanceNameInAppFile) && + (!isDynamicAppearance || !dynamicNamesInAppFile.includes(appearanceNameInAppFile)) ) { entAppearancesNotFoundByFile[appFilePath] ||= {}; entAppearancesNotFoundByFile[appFilePath][appearanceName] = appearanceNameInAppFile;