Sfoglia il codice sorgente

Fixed crash in unified launcher when showing the scoreboard

Signed-off-by: Chris Galvan <[email protected]>
Chris Galvan 2 anni fa
parent
commit
42ac005b80

+ 5 - 4
Gem/Code/Source/Components/Multiplayer/MatchPlayerCoinsComponent.cpp

@@ -23,15 +23,16 @@ namespace MultiplayerSample
 
     void MatchPlayerCoinsComponent::OnActivate([[maybe_unused]] Multiplayer::EntityIsMigrating entityIsMigrating)
     {
-        if (IsNetEntityRoleClient())
-        {
-            AZ::Interface<MatchPlayerCoinsComponent>::Register(this);
-        }
+#if AZ_TRAIT_CLIENT
+        AZ::Interface<MatchPlayerCoinsComponent>::Register(this);
+#endif
     }
 
     void MatchPlayerCoinsComponent::OnDeactivate([[maybe_unused]] Multiplayer::EntityIsMigrating entityIsMigrating)
     {
+#if AZ_TRAIT_CLIENT
         AZ::Interface<MatchPlayerCoinsComponent>::Unregister(this);
+#endif
     }
 
     AZStd::vector<PlayerCoinState> MatchPlayerCoinsComponent::GetPlayerCoinCounts() const