From 0866b381b90aa2d65528ca0813a6b3a63e50cc03 Mon Sep 17 00:00:00 2001 From: div0 Date: Wed, 21 Nov 2007 16:11:45 +0000 Subject: [PATCH] new mapinfo syntax: settemp_for_type all sv_cullentities_trace 0 settemp_for_type ctf sv_fullbright_players 1 git-svn-id: svn://svn.icculus.org/nexuiz/trunk@2984 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- data/qcsrc/common/mapinfo.qc | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/data/qcsrc/common/mapinfo.qc b/data/qcsrc/common/mapinfo.qc index a6e35c11e..94116efb4 100644 --- a/data/qcsrc/common/mapinfo.qc +++ b/data/qcsrc/common/mapinfo.qc @@ -333,6 +333,7 @@ float MapInfo_Type_FromString(string t) else if(t == "kh") return MAPINFO_TYPE_KEYHUNT; else if(t == "as") return MAPINFO_TYPE_ASSAULT; else if(t == "ons") return MAPINFO_TYPE_ONSLAUGHT; + else if(t == "all") return MAPINFO_TYPE_ALL; else return 0; } @@ -416,6 +417,38 @@ float MapInfo_Get_ByName(string pFilename, float pAllowGenerate, float pGametype else dprint("Map ", pFilename, " supports unknown game type ", t, ", ignored\n"); } + else if(t == "settemp_for_type") + { + t = car(s); s = cdr(s); + if((f = MapInfo_Type_FromString(t))) + { + if(f & pGametypeToSet) + { + t = car(s); s = cdr(s); + if(strstrofs(t, "\"", 0) >= 0) + print("Map ", pFilename, " contains a potentially harmful setting, ignored\n"); + else if(strstrofs(t, "\\", 0) >= 0) + print("Map ", pFilename, " contains a potentially harmful setting, ignored\n"); + else if(strstrofs(t, ";", 0) >= 0) + print("Map ", pFilename, " contains a potentially harmful setting, ignored\n"); + else if(strstrofs(s, "\"", 0) >= 0) + print("Map ", pFilename, " contains a potentially harmful setting, ignored\n"); + else if(strstrofs(s, "\\", 0) >= 0) + print("Map ", pFilename, " contains a potentially harmful setting, ignored\n"); + else if(strstrofs(s, ";", 0) >= 0) + print("Map ", pFilename, " contains a potentially harmful setting, ignored\n"); + else + { + dprint("Applying temporary setting ", t, " := ", s, "\n"); + localcmd(strcat("\nsettemp ", t, " \"", s, "\"\n")); + } + } + } + else + { + dprint("Map ", pFilename, " has a setting for unknown game type ", t, ", ignored\n"); + } + } else dprint("Map ", pFilename, " provides unknown info item ", t, ", ignored\n"); } -- 2.39.2