瀏覽代碼

Merge pull request #461 from o3de/cgalvan/FixScoreboardCrashUnifiedLauncher

Fixed crash in unified launcher when showing the scoreboard
Chris Galvan 2 年之前
父節點
當前提交
761fe6d892
共有 1 個文件被更改,包括 5 次插入4 次删除
  1. 5 4
      Gem/Code/Source/Components/Multiplayer/MatchPlayerCoinsComponent.cpp

+ 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