From 53935057cdc06f184cf21944c10aa9810fd001dc Mon Sep 17 00:00:00 2001 From: Zakarya Date: Tue, 28 May 2024 20:27:12 -0700 Subject: [PATCH] Change if to match in mouse capture code --- addons/fpc/character.gd | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/addons/fpc/character.gd b/addons/fpc/character.gd index e5ba68a..daebf32 100644 --- a/addons/fpc/character.gd +++ b/addons/fpc/character.gd @@ -327,10 +327,11 @@ func _process(delta): if pausing_enabled: if Input.is_action_just_pressed(PAUSE): - if Input.mouse_mode == Input.MOUSE_MODE_CAPTURED: - Input.mouse_mode = Input.MOUSE_MODE_VISIBLE - elif Input.mouse_mode == Input.MOUSE_MODE_VISIBLE: - Input.mouse_mode = Input.MOUSE_MODE_CAPTURED + match Input.mouse_mode: + Input.MOUSE_MODE_CAPTURED: + Input.mouse_mode = Input.MOUSE_MODE_VISIBLE + Input.MOUSE_MODE_VISIBLE: + Input.mouse_mode = Input.MOUSE_MODE_CAPTURED HEAD.rotation.x = clamp(HEAD.rotation.x, deg_to_rad(-90), deg_to_rad(90))