9 open my $fh, '<', 'effectinfo.txt';
\r
14 next if /^\/\/ used in /;
\r
15 next if /^\/\/ used nowhere in code$/;
\r
17 if(/^effect\s+([^\s\/]+)\s*(?:\/\/.*)?$/i)
\r
21 print STDERR "Handling $1...\n";
\r
25 $1 eq 'TR_BLOOD' ? 'MF_GIB' :
\r
26 $1 eq 'TR_SLIGHTBLOOD' ? 'MF_ZOMGIB' :
\r
27 $1 eq 'TR_WIZSPIKE' ? 'MF_TRACER' :
\r
28 $1 eq 'TR_KNIGHTSPIKE' ? 'MF_TRACER2' :
\r
29 $1 eq 'TR_ROCKET' ? 'MF_ROCKET' :
\r
30 $1 eq 'TR_GRENADE' ? 'MF_GRENADE' :
\r
31 $1 eq 'TR_VORESPIKE' ? 'MF_TRACER3' :
\r
33 local $ENV{effectre} =
\r
34 $search eq lc $search
\r
35 ? "\"$search\"|\"$search2\""
\r
36 : "\"$search\"|\\<" . lc($search) . "\\>|\\<" . $search . "\\>|"
\r
37 . "\"$search2\"|\\<" . lc($search2) . "\\>|\\<" . $search2 . "\\>";
\r
38 print "$ENV{effectre}\n";
\r
39 my $occurrences = `grep -E "\$effectre" qcsrc/server/*.qc qcsrc/client/*.qc`;
\r
40 $occurrences =~ s/\r/\n/g;
\r
41 $occurrences =~ s/;//g;
\r
43 for(split /\n/, $occurrences)
\r
46 next if /^qcsrc\/server\/gamecommand\.qc:/; # list of quake effects is there
\r
47 next if /^qcsrc\/client\/csqc_builtins\.qc:/; # list of quake effects is there
\r
48 next if /^qcsrc\/client\/csqc_constants\.qc:/; # list of quake effects is there
\r
49 $out .= "// used in $_\n";
\r
54 $out .= "// used nowhere in code\n";
\r
63 open $fh, '>', 'effectinfo.txt';
\r