Skip to content

Commit

Permalink
Fix spec_mode bind not working (#706)
Browse files Browse the repository at this point in the history
Fixes `spec_mode` bind not working by adding a small spectator replay delay

Co-authored-by: DBmaoha <[email protected]>
  • Loading branch information
2 people authored and GeckoEidechse committed Dec 17, 2023
1 parent e49e7e8 commit 93b9c73
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Northstar.CustomServers/mod/scripts/vscripts/mp/_spectator.gnut
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ void function SpectatorFunc_Default( entity player )
{
player.SetObserverTarget( target )
player.StartObserverMode( OBS_MODE_CHASE )
// the delay of 0.1 seems to fix the spec_mode command not working
// when using the keybind
player.SetSpecReplayDelay( 0.1 )
}
catch ( ex ) { }
}
Expand Down Expand Up @@ -215,9 +218,12 @@ bool function ClientCommandCallback_spec_mode( entity player, array<string> args
else if ( player.GetObserverMode() == OBS_MODE_IN_EYE )
{
// set to third person spectate
player.SetSpecReplayDelay( 0.0 )

// the delay of 0.1 seems to fix the spec_mode command not working
// when using the keybind
player.SetSpecReplayDelay( 0.1 )
player.StartObserverMode( OBS_MODE_CHASE )
}

return true
}
}

0 comments on commit 93b9c73

Please sign in to comment.