sm_practicemode_autostart 1 triggers on round start (not just map start)
Lidbetter opened this issue · 2 comments
Expected behavior
When using sm_practicemode_autostart 1
I expect:
- practice mode to be on after changing level (which it is)
- disable practice mode (
sm_exitpractice
) thenmp_restartgame 1
/ get5 scrim, practice mode remains disabled
Actual behavior
When using sm_practicemode_autostart 1
I experience:
- (after exiting prac mode) every time a new round starts practice mode is re-enabled
Steps to reproduce
- Plugin version: 1.3.4
- Sourcemod version: 1.10.0.6524
- Steps to reproduce (please be specific):
- in
csgo/cfg/practicemode.cfg
havesm_practicemode_autostart 1
- disable practice mode via menu or
sm_exitpractice
mp_restartgame 1
- in
Practice mode is also re-enabled on round restart even if sm_practicemode_can_be_started 0
For now I have worked around this issue (because it is nice to have the server start in prac mode) by adding the following lines to the cfg files which get5 executes when starting a scrim
sm_practicemode_autostart 0
sm_exitpractice
So looks like this is intentional:
csgo-practice-mode/scripting/practicemode.sp
Lines 855 to 863 in afab77b
csgo-practice-mode/scripting/practicemode.sp
Lines 747 to 768 in afab77b
Without introducing anymore state, perhaps one way we could address this is to set g_AutostartCvar.IntValue 0
when disabling prac mode (and re-reading from cfg file when (re)enabled (via ingame menu or command))
I would agree the current behavior is a little strange in the way you describe. IMO, once practicemode is turned off by players on a server, it shouldn't be restarted without a map change.
I think I would prefer doing that without actually having to modify the g_AutostartCvar
value.