Kaynağa Gözat

Merge pull request #461 from o3de/cgalvan/FixScoreboardCrashUnifiedLauncher

Fixed crash in unified launcher when showing the scoreboard
Chris Galvan 2 yıl önce
ebeveyn
işleme
761fe6d892

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

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