mirror of
https://gitlab.com/open-fpsz/open-fpsz.git
synced 2026-07-13 23:44:49 +00:00
🐛 Fix crashes when leaving Multiplayer mode
This commit is contained in:
parent
81acb0bdf1
commit
5348b35448
4 changed files with 12 additions and 10 deletions
|
|
@ -53,6 +53,7 @@ enum PlayerState { PLAYER_ALIVE, PLAYER_DEAD }
|
|||
@onready var spring_arm_height : float = $Smoothing/SpringArm3D.position.y
|
||||
@onready var _original_weapon_transform : Transform3D = weapon.transform
|
||||
@onready var flag_carry_attachment : Node3D = $Smoothing/SpringArm3D/FlagCarryAttachment
|
||||
@onready var tp_player : Vanguard = $Smoothing/ThirdPerson/PlayerMesh
|
||||
@onready var _game_settings : Settings = get_node("/root/GlobalSettings")
|
||||
|
||||
signal died(player : Player, killer_id : int)
|
||||
|
|
@ -154,7 +155,7 @@ func _process(_delta : float) -> void:
|
|||
else:
|
||||
iff.show()
|
||||
if not _is_pawn():
|
||||
$Smoothing/ThirdPerson/PlayerMesh.global_transform.basis = Basis.from_euler(Vector3(0.0, input.camera_rotation.x + PI, 0.0))
|
||||
tp_player.global_transform.basis = Basis.from_euler(Vector3(0.0, input.camera_rotation.x + PI, 0.0))
|
||||
elif not %Inventory/SpaceGun/Mesh/AnimationPlayer.is_playing():
|
||||
%Inventory/SpaceGun/Mesh/AnimationPlayer.play("idle")
|
||||
%SpringArm3D.global_transform.basis = Basis.from_euler(Vector3(input.camera_rotation.y, input.camera_rotation.x, 0.0))
|
||||
|
|
@ -211,8 +212,6 @@ func _update_third_person_animations() -> void:
|
|||
if _is_pawn():
|
||||
return
|
||||
|
||||
var tp_player : Vanguard = $Smoothing/ThirdPerson/PlayerMesh
|
||||
|
||||
if _is_player_dead():
|
||||
tp_player.set_ground_state(Vanguard.GroundState.GROUND_STATE_DEAD)
|
||||
return
|
||||
|
|
@ -241,3 +240,7 @@ func respawn(location : Vector3) -> void:
|
|||
linear_velocity = Vector3()
|
||||
health_component.heal_full()
|
||||
position = location
|
||||
|
||||
func _exit_tree() -> void:
|
||||
player_state = PlayerState.PLAYER_DEAD
|
||||
flag_carry_component.drop()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue