diff --git a/scripts/weapon_system/weapon_system.gd b/scripts/weapon_system/weapon_system.gd index c9d6245..00617b2 100644 --- a/scripts/weapon_system/weapon_system.gd +++ b/scripts/weapon_system/weapon_system.gd @@ -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()