Fixed last issue

This commit is contained in:
Rendo 2025-11-28 19:45:59 +05:00
commit b317693619

View file

@ -66,7 +66,7 @@ func switch(to: StringName, exit: bool = true):
switched_to.emit(current_state)
update_remotes.rpc(to)
update_remotes.rpc(to,exit)
func drop():
if slots.find_key(current_state) == "knife":
@ -118,8 +118,8 @@ func return_to_previous(exit: bool = true):
switch("knife", exit)
@rpc("authority","call_remote","reliable")
func update_remotes(to: StringName):
if current_state != null:
func update_remotes(to: StringName,exit: bool):
if current_state != null and exit:
current_state.exit()
current_state = slots[to]
current_state.enter()