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.
This commit is contained in:
@@ -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])
|
||||
|
||||
Reference in New Issue
Block a user