Server side bullet registration

This commit is contained in:
Rendo 2025-11-28 20:50:42 +05:00
commit 26e5fa71e2
5 changed files with 47 additions and 1 deletions

View file

@ -37,7 +37,8 @@ func fire() -> void:
machine.animation_player.stop()
machine.animation_player.play(with_morphems("shoot"))
raycast.try_deal_damage(damage)
if is_multiplayer_authority():
Session.shoot(damage)
fire_timer.start()
machine.player_camera.recoil(horizontal_curve.sample(bullets_shot),vertical_curve.sample(bullets_shot))

View file

@ -100,12 +100,14 @@ func pick_up_weapon(data: Variant) -> Node:
scene.ammo = data["ammo"]
scene.remaining_ammo = data["remaining_ammo"]
scene.slot = data["slot"]
scene.set_multiplayer_authority(get_multiplayer_authority())
add(scene,scene.slot,true)
return scene
else:
var scene: WeaponSubStateMachine = load(data["scene_file_path"]).instantiate()
scene.set_multiplayer_authority(get_multiplayer_authority())
add(scene,scene.slot,true)