From 97de77c6b625f45aeffa5c544f9fca9b045887fe Mon Sep 17 00:00:00 2001 From: historic_bruno Date: Tue, 14 Aug 2012 02:31:54 +0000 Subject: [PATCH] Adds alternative materials to reference checker This was SVN commit r12419. --- source/tools/entity/checkrefs.pl | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/source/tools/entity/checkrefs.pl b/source/tools/entity/checkrefs.pl index 7729aeb8c2..aba2a50de1 100755 --- a/source/tools/entity/checkrefs.pl +++ b/source/tools/entity/checkrefs.pl @@ -144,7 +144,17 @@ sub add_art sub add_materials { print "Loading materials...\n"; - push @files, find_files('art/materials', 'xml'); + my @materialfiles = find_files('art/materials', 'xml'); + for my $f (sort @materialfiles) + { + push @files, $f; + + my $material = XMLin(vfs_to_physical($f), ForceArray => [qw(alternative)], KeyAttr => []); + for my $alternative (@{$material->{alternative}}) + { + push @deps, [ $f, "art/materials/$alternative->{material}" ] if $alternative->{material}; + } + } } sub add_particles