[Micro] Phase fix

This commit is contained in:
Alan Alexander Cerna 2021-11-14 16:13:27 +02:00
parent bf88daafe5
commit 5f1e2d2cb5
2 changed files with 5 additions and 4 deletions

View File

@ -30,7 +30,7 @@ func update(clientPhase):
"r_dec": Input.is_action_pressed("rotation_decrease"),
"shoot": Input.is_action_pressed("input_shoot")
}
if clientPhase != null and clientPhase["active"] != null and clientPhase != "ignore":
if clientPhase != null and clientPhase["active"] != null:
if clientPhase["active"]["phase_id"] == 0:
inputState["r_inc"] = false
inputState["r_dec"] = false
@ -61,5 +61,4 @@ func update(clientPhase):
"r_dec": false,
"shoot": false
}
elif clientPhase == "ignore": pass
return inputState

View File

@ -48,7 +48,7 @@ func phase_update_global():
if activePhaseTracker != null:
if clientPhase[str(activePhaseTracker)]["start_time"] != null:
if currentTime["second"] + currentTime["minute"] * 60 - clientPhase[str(activePhaseTracker)]["start_time"]["second"] - clientPhase[str(activePhaseTracker)]["start_time"]["minute"] * 60 > clientPhase[str(activePhaseTracker)]["length"]:
if activePhaseTracker == clientPhase.size() - 2:
if activePhaseTracker == clientPhase.size() - 3:
clientPhase[str(activePhaseTracker)]["start_time"] = null
activePhaseTracker = 0
else:
@ -57,12 +57,14 @@ func phase_update_global():
else: clientPhase[str(activePhaseTracker)]["start_time"] = currentTime
else: activePhaseTracker = 0
clientPhase["active"] = clientPhase[str(activePhaseTracker)]
else:
clientPhase["active"] = null
activePhaseTracker = null
pass
func start_game(value):
gameStart = value
clientPhase["active"] = "ignore"
pass