Created attachment 2423[details]
Clamp gametype to 4, there is no gametype 5
Q3UI clamps gametype to the range of 0 to 5, but there is no gametype 5 so it should clamp to 4.
There are several more game types defined in bg_public.h. Even they may not be technically implemented, clamping it to a value of GT_MAX_GAME_TYPE - 1 is technically more correct. Also, it won't break anything.
GT_MAX_GAME_TYPE - 1 is technically more correct, but s_serveroptions.gametype would be able to go past the end of the gametype_remap2 array in ServerOptions_LevelshotDraw (which is the only reason to clamp it anyway).
Thilo, those gametypes are used in the missionpack (Quake III: Team Arena). Missionpack will not work now. You could add a enum value (GT_MAX_Q3UI_GAME_TYPE = 4), but it would probable be best to keep q3_ui only stuff in q3_ui.
Maybe clamp to the length of the gametype_remap2 array? (That is why it must be clamped, so it will always be correct.)
s_serveroptions.gametype = (int)Com_Clamp( 0, ARRAY_LEN(gametype_remap2) - 1, trap_Cvar_VariableValue( "g_gametype" ) );
Created attachment 2537[details]
Revert r1796, fix clamping.
The missionpack is still broken. The attached patch fixes the missionpack and closes this bug.
Created attachment 2423 [details] Clamp gametype to 4, there is no gametype 5 Q3UI clamps gametype to the range of 0 to 5, but there is no gametype 5 so it should clamp to 4.
Created attachment 2537 [details] Revert r1796, fix clamping. The missionpack is still broken. The attached patch fixes the missionpack and closes this bug.