Fixed switch override
if/else tab error stupid
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user