Skip to content

Commit

Permalink
finally got rid of false positive (references itself)
Browse files Browse the repository at this point in the history
  • Loading branch information
manavortex committed Oct 27, 2024
1 parent 0000133 commit 21bdc3e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
2 changes: 2 additions & 0 deletions Scripts/Internal/FileValidation/00_shared.wscript
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,10 @@ export function checkDepotPath(_depotPath, _info, allowEmpty = false, suppressLo
switch (getPathToCurrentFile().split('.').pop()) {
case 'ent':
warnAboutSubstitution = entSettings.warnAboutSubstitution;
break;
case 'mesh':
warnAboutSubstitution = meshSettings.enabled;
break;
default:
warnAboutSubstitution = false;
}
Expand Down
12 changes: 10 additions & 2 deletions Scripts/Wolvenkit_FileValidation.wscript
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ function resetInternalFlagsAndCaches() {
meshAppearancesNotFoundByComponent = {};

currentWarnings = {};

// if path to current file isn't set, get it from wkit
pushCurrentFilePath(getPathToCurrentFile());
}

//#region animFile
Expand Down Expand Up @@ -756,8 +759,11 @@ function _validateAppFile(app, validateRecursively, calledFromEntFileValidation)
if (checkIfFileIsBroken(app, 'app')) {
return;
}

pushCurrentFilePath();

if (!(app.appearances ?? []).length) {
Logger.Warning(`No appearances found in ${pathToCurrentFile}. Not validating...`);
return;
}

// empty array with name collisions
componentOverrideCollisions.length = 0;
Expand All @@ -780,6 +786,8 @@ function _validateAppFile(app, validateRecursively, calledFromEntFileValidation)
isWeaponAppFile = (!!baseEntityType && 'None' !== baseEntityType)
|| (!!preset && 'None' !== preset)
|| (!!depotPath && '0' !== depotPath);

pushCurrentFilePath();

for (let i = 0; i < app.appearances.length; i++) {
const appearance = app.appearances[i];
Expand Down
3 changes: 1 addition & 2 deletions Scripts/hook_global.wscript
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ export function RunFileValidation(ext, file) {
FileValidation.validateAnimationFile(data, Settings.Anims);
break;
case "app":
if ((data.appearances?.length || 0) > 0)
FileValidation.validateAppFile(data, Settings.App);
FileValidation.validateAppFile(data, Settings.App);
break;
case "csv":
FileValidation.validateCsvFile(data, Settings.Csv);
Expand Down

0 comments on commit 21bdc3e

Please sign in to comment.