From: drjaska Date: Wed, 20 Dec 2023 22:14:31 +0000 (+0200) Subject: add back playdemo_hook but as unconditional X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=e90d28900205a1d44b5c3757aab28bed8595114c;p=xonotic%2Fxonotic-data.pk3dir.git add back playdemo_hook but as unconditional It no longer only fires on playdemo executions which are successful in demo loading. Now it always fires. This is due to the lack of having proper demo start detection which isn't a hack. Due to the lack of engine callbacks as a demo starts. --- diff --git a/demoseeking.cfg b/demoseeking.cfg index 1b3de41ee..ff4a20a97 100644 --- a/demoseeking.cfg +++ b/demoseeking.cfg @@ -53,6 +53,8 @@ // // 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. @@ -65,14 +67,14 @@ set _demoseeking_fast_speed 80 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 // Populates with the current seek target time, if seeking. If not