--- deliantra/Deliantra-Client/bin/cfplus 2006/11/18 23:31:24 1.128 +++ deliantra/Deliantra-Client/bin/cfplus 2006/11/19 19:43:53 1.130 @@ -1265,11 +1265,17 @@ my %SORT_ORDER = ( type => undef, - mtime => sub { sort { - ($a->{flags} & F_LOCKED) <=> ($b->{flags} & F_LOCKED) - or $b->{mtime} <=> $a->{mtime} - or $a->{type} <=> $b->{type} - } @_ }, + mtime => sub { + my $NOW = time; + sort { + my $atime = $a->{mtime} - $NOW; $atime = $atime < 5 * 60 ? int $atime / 60 : 6; + my $btime = $b->{mtime} - $NOW; $btime = $btime < 5 * 60 ? int $btime / 60 : 6; + + ($a->{flags} & F_LOCKED) <=> ($b->{flags} & F_LOCKED) + or $btime <=> $atime + or $a->{type} <=> $b->{type} + } @_ + }, weight => sub { sort { $a->{weight} * ($a->{nrof} || 1) <=> $b->{weight} * ($b->{nrof} || 1) or $a->{type} <=> $b->{type} @@ -1916,8 +1922,8 @@ audio_music_finished; + local $_; while (<$fh>) { - last; next if /^\s*#/; next if /^\s*$/; @@ -1925,11 +1931,11 @@ push @SOUNDS, "$volume,$file"; -# $AUDIO_CHUNKS{"$volume,$file"} ||= do { -# my $chunk = new_from_file CFPlus::MixChunk CFPlus::find_rcfile "sounds/$file"; -# $chunk->volume ($volume * 128 / 100); -# $chunk -# }; + $AUDIO_CHUNKS{"$volume,$file"} ||= do { + my $chunk = new_from_file CFPlus::MixChunk CFPlus::find_rcfile "sounds/$file"; + $chunk->volume ($volume * 128 / 100); + $chunk + }; } } else { status "unable to open sound config: $!";