diff --git a/Assets/Scripts/Gameplay/CrowManager.cs b/Assets/Scripts/Gameplay/CrowManager.cs
index 582358e..b4b5ead 100644
--- a/Assets/Scripts/Gameplay/CrowManager.cs
+++ b/Assets/Scripts/Gameplay/CrowManager.cs
@@ -109,19 +109,23 @@ public class CrowManager : NetworkBehaviour
///
/// Clears the current Crow if no player is unoccupied.
///
- private void ClearCrow()
+ public void ClearCrow()
{
if (currentCrow != null)
{
+ Debug.Log($"[CrowManager] {currentCrow.name} landed on a platform. Removing crow status.");
currentCrow.SetAsCrow(false);
- Debug.Log($"{currentCrow.name} is no longer the Crow.");
currentCrow = null;
- // Notify all clients about the crow being cleared
- NotifyCrowChangeClientRpc(0); // 0 indicates no crow
+ // Notify all clients that the crow role is cleared
+ NotifyCrowChangeClientRpc(0); // 0 means no crow
}
+
+ // Recalculate crow status after removing the old crow
+ DetermineCrow();
}
+
///
diff --git a/Assets/Scripts/Gameplay/Platform.cs b/Assets/Scripts/Gameplay/Platform.cs
index 3445475..08277d8 100644
--- a/Assets/Scripts/Gameplay/Platform.cs
+++ b/Assets/Scripts/Gameplay/Platform.cs
@@ -190,6 +190,14 @@ namespace Unity.Multiplayer.Samples.BossRoom
{
return;
}
+
+ // If the player is currently the crow, convert them back into a normal player
+ if (player.IsCrow)
+ {
+ Debug.Log($"[Platform] Crow {player.name} landed on platform {PlatformID.Value}, converting back to player.");
+ CrowManager.Instance.ClearCrow(); // Notify CrowManager to clear the current crow
+ }
+
IsOccupied = true;
occupierId.Value = player.OwnerClientId;
player.OnArrivalOnPlatform(PlatformID.Value);
@@ -253,6 +261,7 @@ namespace Unity.Multiplayer.Samples.BossRoom
timerCoroutine = StartCoroutine(UpdateTimerShader(maxTime));
}
}
+
[ClientRpc]
private void PauseClientRpc()
{