Fixed switch override

if/else tab error stupid
This commit is contained in:
derek
2024-10-14 13:28:37 -05:00
parent 735a48b21d
commit 784a9865ab
2 changed files with 21 additions and 14 deletions

View File

@@ -17,6 +17,9 @@ func _ready() -> void:
switch_override = i
else:
switches.append(i)
print("switches " + str(switches))
print("override switches " + str(switch_override))
func _on_switch_changed() -> void:
@@ -27,17 +30,22 @@ func _on_switch_changed() -> void:
switches_on += 1
#First check override switch and open or close door
if switch_override.switched_on:
if door.door_open == false:
door.open()
else:
if door.door_open == true:
door.close()
if switch_override != null:
print("null check passed")
if switch_override.switched_on:
print("switched on")
if door.door_open == false:
door.open()
else:
if door.door_open == true:
door.close()
#Otherwise follow standard switches
elif switches_on >= switches_needed:
if door.door_open == false:
door.open()
else:
if door.door_open == true:
door.close()
elif switches_on == switches_needed:
print("switch check run with " + str(switches_on) + "switches on")
if door.door_open == false:
door.open()
else:
print("switch check run with " + str(switches_on) + "switches on")
if door.door_open == true:
door.close()