Skip to content

Commit

Permalink
fixed a logic check in file validation
Browse files Browse the repository at this point in the history
  • Loading branch information
manavortex committed May 18, 2024
1 parent e7572cc commit 42273fe
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Scripts/Wolvenkit_FileValidation.wscript
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,6 @@ function checkIfFileIsBroken(data, fileType, _info = '') {
infoMsg.push(`${info}: entity is null. This file will probably not work.`)
break;
}
infoMsg.push(`${info}: If this .ent file belongs to a character, you can ignore this.`)
infoMsg.push(`If this is an item, this will not work (best-case) or crash your game (worst-case):`)
if (!data.components) {
errorMsg.push('"components" doesn\'t exist. There\'s a good chance that this file won\'t work.');
}
Expand All @@ -114,10 +112,14 @@ function checkIfFileIsBroken(data, fileType, _info = '') {
break;
}

if (!infoMsg.length && !errorMsg.length) {
if (!errorMsg.length && !infoMsg.length) {
return false;
}

if (errorMsg.length && !infoMsg.length) {
infoMsg.push(`${info}: If this .ent file belongs to a character, you can ignore this.`);
infoMsg.push(`If this is an item, this will not work (best-case) or crash your game (worst-case):`);
}

infoMsg.forEach((msg) => Logger.Warning(`${msg}`));
errorMsg.forEach((msg) => Logger.Warning(`\t${msg}`));
return true;
Expand Down

0 comments on commit 42273fe

Please sign in to comment.