From 7db8434f7e26dde21f6aee052a5c94d9a0d598bf Mon Sep 17 00:00:00 2001 From: Shawn Date: Fri, 3 Jul 2026 20:07:40 -0400 Subject: [PATCH] Fix duplicate _rollback_tick causing WeaponManager compile error A debug-print attempt from earlier inadvertently appended a second _rollback_tick function (with spaces instead of tabs) at the end of weapon_manager.gd:419, causing the entire script to fail compilation. This meant the WeaponManager node had NO script attached: - 'has_method("set_default_loadout")' returned false - Client-side loadout init never ran - All weapon operations silently did nothing This is the real root cause of why weapons never worked on the client. --- examples/multiplayer-fps/scripts/weapon_manager.gd | 9 --------- 1 file changed, 9 deletions(-) diff --git a/examples/multiplayer-fps/scripts/weapon_manager.gd b/examples/multiplayer-fps/scripts/weapon_manager.gd index 8b4b7a6..94f96f8 100644 --- a/examples/multiplayer-fps/scripts/weapon_manager.gd +++ b/examples/multiplayer-fps/scripts/weapon_manager.gd @@ -164,10 +164,6 @@ func _rollback_tick(delta: float, tick: int, _is_fresh: bool): # We process weapon actions anyway — the server reconciles via rollback. # Only skip if the player is dead or frozen (checked below). - # Skip if player dead - if input and (input.slot_1 or input.slot_2 or input.slot_3 or input.slot_4): - print("[WEAPON DEBUG] _rollback_tick tick=%d slots=[s1=%s s2=%s s3=%s s4=%s] active=%d inv=%s" % [tick, input.slot_1, input.slot_2, input.slot_3, input.slot_4, active_slot, inventory]) - # Skip if player dead if player.death_tick >= 0 and tick >= player.death_tick: return @@ -413,8 +409,3 @@ func _spawn_grenade(origin: Vector3, direction: Vector3, owner_id: int, type_idx get_tree().current_scene.add_child(grenade) var gtype: Grenade.GrenadeType = Grenade.GrenadeType.FLASH if type_idx == 0 else Grenade.GrenadeType.SMOKE grenade.setup(origin, direction, owner_id, gtype) - -func _rollback_tick(delta: float, tick: int, _is_fresh: bool): - # DEBUG: Log when this is called with non-default input - if input and (input.slot_1 or input.slot_2 or input.slot_3 or input.slot_4): - print("[WEAPON DEBUG] _rollback_tick tick=%d slots=[%s %s %s %s]" % [tick, input.slot_1, input.slot_2, input.slot_3, input.slot_4])