OldUnreal / UnrealTournamentPatches

Other
1k stars 29 forks source link

[469b] MusicEvent with bAffectAllPlayers not affect players which join to game after fire event #460

Open SeriousBuggie opened 3 years ago

SeriousBuggie commented 3 years ago

https://github.com/Slipyx/UT99/blob/f2ebd703845075a2d667e8e3f2f71a5e7f187610/Engine/MusicEvent.uc#L30

function Trigger( actor Other, pawn EventInstigator )
{
    local PlayerPawn P;
    local Pawn A;

    if( bAffectAllPlayers )
    {
        A = Level.PawnList;
        While ( A != None )
        {
            if ( A.IsA('PlayerPawn') )
                PlayerPawn(A).ClientSetMusic( Song, SongSection, CdTrack, Transition );
            A = A.nextPawn;
        }
    }

This code fine only for current players. If new player join to game then he hear default music for level.

Possible need store current music somewhere and set it for joined players for avoid music desync.

SeriousBuggie commented 1 year ago

It can be change LevelInfo Song too with some ability replicate it before client start play music. or with ability restart already playing music after replication.