diff --git a/config/scripts.cfg b/config/scripts.cfg index edf621ca..c3fda816 100644 --- a/config/scripts.cfg +++ b/config/scripts.cfg @@ -524,6 +524,8 @@ const applygamma [ addOnLoadAlways applygamma +alias togglepause [pause (! (curpausemode) ) ] + // get optional scripts on demand tempalias load_autosave [ run opt/autosave ; alias load_autosave [] ] tempalias load_compatibility [ run opt/compatibility ; alias load_compatibility [] ] diff --git a/source/src/serveractions.h b/source/src/serveractions.h index b0a86303..054cf08a 100644 --- a/source/src/serveractions.h +++ b/source/src/serveractions.h @@ -237,10 +237,11 @@ struct pauseaction : serveraction { int mode; void perform() { setpausemode(mode); } + virtual bool isvalid() { return sg->mastermode == MM_MATCH; } pauseaction(int mode) : mode(mode) { role = roleconf('p'); - copystring(desc, (mode == 1) ? "pause the game" : "resume the game"); + if(isvalid()) copystring(desc, (mode == 1) ? "pause the game" : "resume the game"); } };