}
ScriptParser parser = new ScriptParser(scriptPath.toFile());
TreeModel scriptTree = parser.getTreeModel();
if (needsValidation)
{
CacheManager cm = CacheManager.getInstance();
boolean isUpToDate = this.validateScriptFile(scriptKey, "scripts/game_sounds_heroes/" + scriptKey);
if (!isUpToDate)
{
this.writeHeroScriptFile(cm.getCachedVpkEntry(), true);
mergeNewChanges(scriptTree, scriptPath);
this.updateCache(cm.getCachedVpkEntry().getName() + ".txt", cm.getCachedVpkEntry().getCRC32());
}
}
this.currentTreeModel = scriptTree;
//TODO: Break this out into separate method