Player input is now client-side
This commit is contained in:
parent
fb4e1e5737
commit
76647fc2fc
3 changed files with 73 additions and 37 deletions
|
|
@ -172,40 +172,3 @@ func _physics_process(delta: float) -> void:
|
|||
if current_state == null or disabled:
|
||||
return
|
||||
current_state.physics_update(delta)
|
||||
|
||||
func _input(event: InputEvent) -> void:
|
||||
if is_multiplayer_authority() == false or disabled: return
|
||||
|
||||
if current_state != null:
|
||||
current_state.state_input(event)
|
||||
|
||||
if event.is_action_pressed("plr_ult"):
|
||||
switch("ultimate")
|
||||
elif event.is_action_pressed("plr_bomb"):
|
||||
switch("bomb")
|
||||
elif event.is_action_pressed("plr_primary"):
|
||||
switch("primary")
|
||||
elif event.is_action_pressed("plr_active_first"):
|
||||
switch("ability_first")
|
||||
elif event.is_action_pressed("plr_active_second"):
|
||||
switch("ability_second")
|
||||
elif event.is_action_pressed("plr_active_third"):
|
||||
switch("ability_third")
|
||||
elif event.is_action_pressed("plr_secondary"):
|
||||
switch("secondary")
|
||||
elif event.is_action_pressed("plr_knife"):
|
||||
switch("knife")
|
||||
|
||||
if not Session.round_state == Session.ROUND_STATES.BUY and not player.passived:
|
||||
if event.is_action_pressed("plr_fire"):
|
||||
current_state.use_begin.rpc()
|
||||
if event.is_action_released("plr_fire"):
|
||||
current_state.use_end.rpc()
|
||||
if event.is_action_pressed("plr_scope"):
|
||||
current_state.alternate_state()
|
||||
if event.is_action_pressed("plr_firemode"):
|
||||
current_state.switch_mode()
|
||||
|
||||
if event.is_action_pressed("plr_drop"):
|
||||
drop_current()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue