Server side bullet registration
This commit is contained in:
parent
b317693619
commit
26e5fa71e2
5 changed files with 47 additions and 1 deletions
|
|
@ -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))
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue