//
// Extras:
//
+// - The alias playdemo_hook is run when playdemo command is called.
+// Regardless of its success to load a demo with that name.
// - The alias seekdemo_hook_seek_end is run after a seek completed successfully.
// - The alias seekdemo_getseektime can be used by scripts to get the current
// playback time or seek target time. See its usage below.
set _demoseeking_speed_factor 10
// state initialization
-alias _demoseeking_init_vars "set _demoseeking_vars_loaded 1; set _seekdemo_demo_is_playing 0; set _current_demo_name \"\"; set _demoseeking_is_seeking 0; set _seekdemo_state idle; set _seekdemo_target 0; alias seekdemo_hook_seek_end"
+alias _demoseeking_init_vars "set _demoseeking_vars_loaded 1; set _seekdemo_demo_is_playing 0; set _current_demo_name \"\"; set _demoseeking_is_seeking 0; set _seekdemo_state idle; set _seekdemo_target 0; alias playdemo_hook \"\"; alias seekdemo_hook_seek_end"
alias _demoseeking_init_vars1 ""
_demoseeking_init_vars${_demoseeking_vars_loaded ?}
// Hook into "playdemo" command. This alias runs immediately after the actual
// "playdemo" command runs. Needed for seekdemo to restart the demo when
// seeking backwards.
-alias playdemo "set _current_demo_name \"$1\""
+alias playdemo "set _current_demo_name \"$1\"; playdemo_hook \"$1\""
// usage: seekdemo_getseektime <varname>
// Populates <varname> with the current seek target time, if seeking. If not