1
0
forked from 0ad/0ad

Fix checkrefs script following eab4f9fdde (phenotypes), and fix the unit_motion_integration_test map from b637fdbae9.

In eab4f9fdde the `gender`-tag was replaced with `phenotype`. the
checkrefs script however was not updated and complained.

b637fdbae9 introduced a map that checkrefs did not validate.

Based on a patch by: Freagarach
Differential Revision: https://code.wildfiregames.com/D2141
This was SVN commit r22647.
This commit is contained in:
wraitii 2019-08-12 08:03:23 +00:00
parent b152ee155f
commit 801d5cbe68
2 changed files with 26 additions and 11 deletions

View File

@ -135,26 +135,41 @@ sub add_entities
if ($f !~ /^template_/)
{
push @roots, $path;
if ($ent->{Entity}{VisualActor})
if ($ent->{Entity}{VisualActor} and $ent->{Entity}{VisualActor}{Actor})
{
push @deps, [ $path, "art/actors/" . $ent->{Entity}{VisualActor}{Actor}{' content'} ] if $ent->{Entity}{VisualActor}{Actor};
my $phenotypes = $ent->{Entity}{Identity}{Phenotype}{' content'} || "default";
my @phenotypes = split /\s/,$phenotypes;
for my $phenotype (@phenotypes)
{
# See simulation2/components/CCmpVisualActor.cpp and Identity.js for explanation.
my $actorPath = $ent->{Entity}{VisualActor}{Actor}{' content'};
$actorPath =~ s/{phenotype}/$phenotype/g;
push @deps, [ $path, "art/actors/" . $actorPath ];
}
push @deps, [ $path, "art/actors/" . $ent->{Entity}{VisualActor}{FoundationActor}{' content'} ] if $ent->{Entity}{VisualActor}{FoundationActor};
}
if ($ent->{Entity}{Sound})
{
my $gender = $ent->{Entity}{Identity}{Gender}{' content'} || "male";
my $phenotypes = $ent->{Entity}{Identity}{Phenotype}{' content'} || "default";
my $lang = $ent->{Entity}{Identity}{Lang}{' content'} || "greek";
my @phenotypes = split /\s/,$phenotypes;
for my $phenotype (@phenotypes)
{
for (grep ref($_), values %{$ent->{Entity}{Sound}{SoundGroups}})
{
# see simulation/components/Sound.js and Identity.js for explanation
my $soundPath = $_->{' content'};
$soundPath =~ s/{gender}/$gender/g;
$soundPath =~ s/{phenotype}/$phenotype/g;
$soundPath =~ s/{lang}/$lang/g;
push @deps, [ $path, "audio/" . $soundPath ];
}
}
}
if ($ent->{Entity}{Identity})
{