From 582dfe394fe2a165d1a59ee1d3a365fcf0e7f37e Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Wed, 19 Nov 2008 17:16:18 +0000 Subject: [PATCH] cleaning up demo mode name weirdness git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@3647 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- config/admin.cfg | 2 +- source/src/protocol.cpp | 6 ++++-- source/src/protocol.h | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/config/admin.cfg b/config/admin.cfg index bf24cf05..b4749b3d 100644 --- a/config/admin.cfg +++ b/config/admin.cfg @@ -12,4 +12,4 @@ alias cleardemo [ callvote 10 $arg1 ] alias cleardemos [ callvote 10 0 ] alias serverdesc [ callvote 11 $arg1 ] alias shuffleteams [ callvote 12 ] -alias demo [ mode -3; map $arg1 ] +alias demo [ mode -1; map $arg1 ] diff --git a/source/src/protocol.cpp b/source/src/protocol.cpp index c7615e85..1a86db9c 100644 --- a/source/src/protocol.cpp +++ b/source/src/protocol.cpp @@ -113,6 +113,7 @@ void filtertext(char *dst, const char *src, int whitespace, int len) const char *modefullnames[] = { + "demo playback", "team deathmatch", "coopedit", "deathmatch", "survivor", "team survivor", "ctf", "pistol frenzy", "bot team deathmatch", "bot deathmatch", "last swiss standing", "one shot, one kill", "team one shot, one kill", "bot one shot, one kill", "hunt the flag", "team keep the flag", "keep the flag" @@ -120,14 +121,15 @@ const char *modefullnames[] = const char *modeacronymnames[] = { + "DEMO", "TDM", "coop", "DM", "SURV", "TSURV", "CTF", "PF", "BTDM", "BDM", "LSS", "OSOK", "TOSOK", "BOSOK", "HTF", "TKTF", "KTF" }; const char *voteerrors[] = { "voting is currently disabled", "there is already a vote pending", "already voted", "can't vote that often", "this vote is not allowed in the current environment (singleplayer/multiplayer)", "no permission", "invalid vote" }; -const char *fullmodestr(int n) { return (n>=0 && (size_t)n < sizeof(modefullnames)/sizeof(modefullnames[0])) ? modefullnames[n] : n==-3 ? "demoplayback" : "unknown"; } -const char *acronymmodestr(int n) { return (n>=0 && (size_t)n < sizeof(modeacronymnames)/sizeof(modeacronymnames[0])) ? modeacronymnames[n] : n==-3 ? "DEMO" : "n/a"; } +const char *fullmodestr(int n) { return (n>=-1 && size_t(n+1) < sizeof(modefullnames)/sizeof(modefullnames[0])) ? modefullnames[n+1] : "unknown"; } +const char *acronymmodestr(int n) { return (n>=-1 && size_t(n+1) < sizeof(modeacronymnames)/sizeof(modeacronymnames[0])) ? modeacronymnames[n+1] : "n/a"; } const char *modestr(int n, bool acronyms) { return acronyms ? acronymmodestr (n) : fullmodestr(n); } const char *voteerrorstr(int n) { return (n>=0 && (size_t)n < sizeof(voteerrors)/sizeof(voteerrors[0])) ? voteerrors[n] : "unknown"; } diff --git a/source/src/protocol.h b/source/src/protocol.h index 9a975e45..f4cefc69 100644 --- a/source/src/protocol.h +++ b/source/src/protocol.h @@ -130,8 +130,8 @@ enum #define m_teammode (gamemode==0 || gamemode==4 || gamemode==5 || gamemode==7 || gamemode==11 || gamemode==13 || gamemode==14) #define m_tarena (m_arena && m_teammode) #define m_botmode (gamemode==7 || gamemode == 8 || gamemode==12) -#define m_valid(mode) (((mode)>=0 && (mode)<=15) || (mode) == -3) +#define m_valid(mode) (((mode)>=0 && (mode)<=15) || (mode) == -1) #define m_mp(mode) (m_valid(mode) && (mode)!=7 && (mode)!=8 && (mode)!=12) -#define m_demo (gamemode==-3) +#define m_demo (gamemode==-1) #define m_flags (m_ctf || m_htf || m_ktf)