OldUnreal / UnrealTournamentPatches

Other
997 stars 29 forks source link

[469b] Flood in the log when spectator try use voice menu #386

Closed SeriousBuggie closed 3 years ago

SeriousBuggie commented 3 years ago
ScriptLog: SpeechChildWindow: Critical error, V is none.
ScriptLog: SpeechChildWindow: Critical error, V is none.
Error: OrdersChildWindow Transient.OrdersChildWindow0 (Function UTMenu.OrdersChildWindow.Created:00E1) Accessed null class context 'V'
Error: OrdersChildWindow Transient.OrdersChildWindow0 (Function UTMenu.OrdersChildWindow.Created:00E1) Accessed null class context 'V'
Error: OrdersChildWindow Transient.OrdersChildWindow0 (Function UTMenu.OrdersChildWindow.Created:00E1) Accessed null class context 'V'

Reproduce:

  1. Set spectator in player settings.
  2. Start practice session.
  3. Hold V for bring voice menu.
  4. Select some options.

Expected result: This menu not called at all for spectators. Actual results: Menu showed and flood in log appear. No any real usage for it.

SeriousBuggie commented 3 years ago

https://github.com/Slipyx/UT99/blob/a26a3359704873df5a24d0b241a32ca5fc36a8b7/UTMenu/OrdersChildWindow.uc#L18

    V = class<ChallengeVoicePack>(GetPlayerOwner().PlayerReplicationInfo.VoiceType);

GetPlayerOwner().PlayerReplicationInfo.VoiceType is None for spectator.

Fix: Do not show voice menu at all: https://github.com/Slipyx/UT99/blob/a26a3359704873df5a24d0b241a32ca5fc36a8b7/UTMenu/UTConsole.uc#L46

        if ( !bShowSpeech && !bTyping )

replace to

        if ( !bShowSpeech && !bTyping && ViewPort.Actor.PlayerReplicationInfo.VoiceType != None )