- k = substring(sa, 0, p);
- v = substring(sa, p+1, -1);
-
- if(k == "timelimit")
- {
- cvar_set("timelimit", v);
- }
- else if(k == "leadlimit")
- {
- cvar_set("leadlimit", v);
- }
- else if(k == "pointlimit" || k == "fraglimit" || k == "lives" || k == "laplimit" || k == "caplimit")
- {
- fraglimit_normal = v;
- }
- else if(k == "teampointlimit" || k == "teamlaplimit")
- {
- fraglimit_teams = v;
- }
- else if(k == "teams")
- {
- cvar_set("g_tdm_teams", v);
- cvar_set("g_ca_teams", v);
- cvar_set("g_freezetag_teams", v);
- cvar_set("g_keyhunt_teams", v);
- cvar_set("g_domination_default_teams", v);
- cvar_set("g_invasion_teams", v);
- }
- else if(k == "qualifying_timelimit")
- {
- cvar_set("g_race_qualifying_timelimit", v);
- }
- else if(k == "skill")
- {
- // ignore
- }
- else
- {
- LOG_INFO("Invalid gametype setting in mapinfo for gametype ", MapInfo_Type_ToString(pWantedType), ": ", sa, "\n");
+ string k = substring(sa, 0, p);
+ string v = substring(sa, p + 1, -1);
+ bool handled = true;
+ switch (k) {
+ case "timelimit":
+ {
+ cvar_set("timelimit", v);
+ break;
+ }
+ case "leadlimit":
+ {
+ cvar_set("leadlimit", v);
+ break;
+ }
+ case "pointlimit":
+ case "fraglimit":
+ case "lives":
+ case "laplimit":
+ case "caplimit":
+ {
+ fraglimit_normal = v;
+ break;
+ }
+ case "teampointlimit":
+ case "teamlaplimit":
+ {
+ fraglimit_teams = v;
+ break;
+ }
+ default:
+ {
+ handled = false;
+ break;
+ }