--- deliantra/server/ext/player-env.ext 2007/07/12 18:56:33 1.5 +++ deliantra/server/ext/player-env.ext 2007/07/23 16:53:15 1.8 @@ -24,20 +24,17 @@ while () { for (keys %MUSIC_QUEUE) { delete $MUSIC_QUEUE{$_}; - my $pl = cf::player::find_active $_ - or next; - my $ns = $pl->ns - or next; + cf::get_slot 0.01, -10; - $ns->extcmd - or next; + my $pl = cf::player::find_active $_ or next; + $pl->ob->active or next; + my $ns = $pl->ns or next; + $ns->extcmd or next; + my $map = $pl->ob->map or next; my $faces; - my $map = $pl->ob->map - or next; - # 1. update map-specific music info unless (exists $map->{music_faces}) { $map->{music_faces} = parse_facelist "music/", $map->{music}; @@ -74,15 +71,14 @@ $ns->{current_music_faces} = $facestr; my $msg = { - faces => $faces, + play => $faces, }; - $msg->{chksum}{$_} = cf::face::get_chksum $_ + my $pri = 0; + push @{$msg->{faces}}, [$_, $pri++, cf::face::get_chksum $_] for grep $ns->must_send_face ($_), @$faces; $ns->ext_event (music => %$msg); - - cf::cede_to_tick; } Coro::schedule unless %MUSIC_QUEUE; }