소스 검색

:beetle: Release reference of commander once disconnected

DricomDragon 1 년 전
부모
커밋
c1fda15600
2개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      first3d/component/entity/vehicles/jeep/jeep.gd
  2. 1 0
      first3d/component/entity/vehicles/plane/tiny_plane.gd

+ 1 - 0
first3d/component/entity/vehicles/jeep/jeep.gd

@@ -20,6 +20,7 @@ func drive_with(commander: LocalInput) -> void:
 func get_out() -> void:
 	_current_commander.dir_changed.disconnect(_on_dir_changed)
 	_current_commander.main_action.disconnect(_on_main_action)
+	_current_commander = null
 
 
 func get_free_seat() -> Node3D:

+ 1 - 0
first3d/component/entity/vehicles/plane/tiny_plane.gd

@@ -37,6 +37,7 @@ func drive_with(commander: LocalInput) -> void:
 func get_out() -> void:
 	_current_commander.dir_changed.disconnect(_on_dir_changed)
 	_current_commander.main_action.disconnect(_on_main_action)
+	_current_commander = null
 
 
 func _physics_process(delta: float) -> void: