fix: a lot of networking bugs

This commit is contained in:
DottsGit
2026-06-06 19:26:22 -04:00
parent ff3e01a9e5
commit dbbfbef4a4
7 changed files with 194 additions and 109 deletions
+12 -5
View File
@@ -102,12 +102,19 @@ func _physics_process(delta: float) -> void:
if ignited and is_instance_valid(weapon_source):
var target_dir: Vector3 = initial_aim_dir
var is_painting = weapon_source.get("is_targeting")
var is_painting = false
var target: Vector3 = Vector3.ZERO
if is_painting != null and is_painting:
var target: Vector3 = weapon_source.get("homing_target_pos")
if target != null and target != Vector3.ZERO:
target_dir = (target - global_position).normalized()
if weapon_source.get("player") and weapon_source.player:
is_painting = weapon_source.player.synced_is_targeting
target = weapon_source.player.synced_homing_target_pos
else:
is_painting = weapon_source.get("is_targeting")
if is_painting != null and is_painting:
target = weapon_source.get("homing_target_pos")
if is_painting and target != Vector3.ZERO:
target_dir = (target - global_position).normalized()
if target_dir != Vector3.ZERO:
var current_dir = velocity.normalized()