fix(GameManager): give a default value to lastState just in case
This commit is contained in:
parent
d9580450cc
commit
24c001dcc7
@ -297,6 +297,8 @@ public void StartGame()
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void OnRoomUpdate(object sender, ValueChangedEventArgs e)
|
private void OnRoomUpdate(object sender, ValueChangedEventArgs e)
|
||||||
{
|
{
|
||||||
|
GameState lastState = myRoom != null ? (GameState)myRoom.currentState : GameState.EnteringName;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (e?.Snapshot?.GetRawJsonValue() != null)
|
if (e?.Snapshot?.GetRawJsonValue() != null)
|
||||||
@ -316,7 +318,6 @@ private void OnRoomUpdate(object sender, ValueChangedEventArgs e)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
GameState lastState = (GameState)myRoom.currentState;
|
|
||||||
|
|
||||||
Debug.Log($"lasState = {lastState}. Currentstep = {(GameState)myRoom.currentState}", this);
|
Debug.Log($"lasState = {lastState}. Currentstep = {(GameState)myRoom.currentState}", this);
|
||||||
if (myRoom.currentState != (int)lastState)
|
if (myRoom.currentState != (int)lastState)
|
||||||
|
Loading…
Reference in New Issue
Block a user