void CG_SiegeBriefingDisplay(int team, int dontshow) { char teamstr[64]; char briefing[8192]; char properValue[1024]; char objectiveDesc[1024]; int i = 1; int useTeam = team; qboolean primary = qfalse; if (!siege_valid) { return; } if (team == TEAM_SPECTATOR) { return; } if (team == SIEGETEAM_TEAM1) { Com_sprintf(teamstr, sizeof(teamstr), team1); } else { Com_sprintf(teamstr, sizeof(teamstr), team2); } if (useTeam != SIEGETEAM_TEAM1 && useTeam != SIEGETEAM_TEAM2) { //This shouldn't be happening. But just fall back to team 2 anyway. useTeam = SIEGETEAM_TEAM2; } //[SIEGECVARFIX] siege_Cvar_Set(va("siege_primobj_inuse"), "0"); //trap_Cvar_Set(va("siege_primobj_inuse"), "0"); //[/SIEGECVARFIX] while (i < 16) { //do up to 16 objectives I suppose //Get the value for this objective on this team //Now set the cvar for the menu to display. //primary = (CG_SiegeGetObjectiveFinal(useTeam, i)>-1)?qtrue:qfalse; primary = (CG_SiegeGetObjectiveFinal(useTeam, i)>0)?qtrue:qfalse; properValue[0] = 0; trap_Cvar_VariableStringBuffer(va("team%i_objective%i", useTeam, i), properValue, 1024); if (primary) { //[SIEGECVARFIX] siege_Cvar_Set(va("siege_primobj"), properValue); //trap_Cvar_Set(va("siege_primobj"), properValue); //[/SIEGECVARFIX] } else { //[SIEGECVARFIX] siege_Cvar_Set(va("siege_objective%i", i), properValue); //trap_Cvar_Set(va("siege_objective%i", i), properValue); //[/SIEGECVARFIX] } //Now set the long desc cvar for the menu to display. properValue[0] = 0; trap_Cvar_VariableStringBuffer(va("team%i_objective%i_longdesc", useTeam, i), properValue, 1024); if (primary) { //[SIEGECVARFIX] siege_Cvar_Set(va("siege_primobj_longdesc"), properValue); //trap_Cvar_Set(va("siege_primobj_longdesc"), properValue); //[/SIEGECVARFIX] } else { //[SIEGECVARFIX] siege_Cvar_Set(va("siege_objective%i_longdesc", i), properValue); //trap_Cvar_Set(va("siege_objective%i_longdesc", i), properValue); //[/SIEGECVARFIX] } //Now set the gfx cvar for the menu to display. properValue[0] = 0; trap_Cvar_VariableStringBuffer(va("team%i_objective%i_gfx", useTeam, i), properValue, 1024); if (primary) { //[SIEGECVARFIX] siege_Cvar_Set(va("siege_primobj_gfx"), properValue); //trap_Cvar_Set(va("siege_primobj_gfx"), properValue); //[/SIEGECVARFIX] } else { //[SIEGECVARFIX] siege_Cvar_Set(va("siege_objective%i_gfx", i), properValue); //trap_Cvar_Set(va("siege_objective%i_gfx", i), properValue); //[/SIEGECVARFIX] } //Now set the mapicon cvar for the menu to display. properValue[0] = 0; trap_Cvar_VariableStringBuffer(va("team%i_objective%i_mapicon", useTeam, i), properValue, 1024); if (primary) { //[SIEGECVARFIX] siege_Cvar_Set(va("siege_primobj_mapicon"), properValue); //trap_Cvar_Set(va("siege_primobj_mapicon"), properValue); //[/SIEGECVARFIX] } else { //[SIEGECVARFIX] siege_Cvar_Set(va("siege_objective%i_mapicon", i), properValue); //trap_Cvar_Set(va("siege_objective%i_mapicon", i), properValue); //[/SIEGECVARFIX] } //Now set the mappos cvar for the menu to display. properValue[0] = 0; trap_Cvar_VariableStringBuffer(va("team%i_objective%i_mappos", useTeam, i), properValue, 1024); if (primary) { //[SIEGECVARFIX] siege_Cvar_Set(va("siege_primobj_mappos"), properValue); //trap_Cvar_Set(va("siege_primobj_mappos"), properValue); //[/SIEGECVARFIX] } else { //[SIEGECVARFIX] siege_Cvar_Set(va("siege_objective%i_mappos", i), properValue); //trap_Cvar_Set(va("siege_objective%i_mappos", i), properValue); //[/SIEGECVARFIX] } //Now set the description cvar for the objective CG_SiegeGetObjectiveDescription(useTeam, i, objectiveDesc); if (objectiveDesc[0]) { //found a valid objective description if ( primary ) { //[SIEGECVARFIX] siege_Cvar_Set(va("siege_primobj_desc"), objectiveDesc); //this one is marked not in use because it gets primobj siege_Cvar_Set(va("siege_objective%i_inuse", i), "0"); siege_Cvar_Set(va("siege_primobj_inuse"), "1"); //trap_Cvar_Set(va("siege_primobj_desc"), objectiveDesc); ////this one is marked not in use because it gets primobj //trap_Cvar_Set(va("siege_objective%i_inuse", i), "0"); //trap_Cvar_Set(va("siege_primobj_inuse"), "1"); //[/SIEGECVARFIX] trap_Cvar_Set(va("team%i_objective%i_inuse", useTeam, i), "1"); } else { //[SIEGECVARFIX] siege_Cvar_Set(va("siege_objective%i_desc", i), objectiveDesc); siege_Cvar_Set(va("siege_objective%i_inuse", i), "2"); //trap_Cvar_Set(va("siege_objective%i_desc", i), objectiveDesc); //trap_Cvar_Set(va("siege_objective%i_inuse", i), "2"); //[/SIEGECVARFIX] trap_Cvar_Set(va("team%i_objective%i_inuse", useTeam, i), "2"); } } //[SIEGECVARFIX] else { //didn't find one, so set the "inuse" cvar to 0 for the objective and mark it non-complete. properValue[0] = 0; trap_Cvar_VariableStringBuffer(va("team%i_objective%i", useTeam, i), properValue, 1024); if(properValue[0]) { //siege_Cvar_Set(va("siege_objective%i_inuse", i), "0"); //siege_Cvar_Set(va("siege_objective%i", i), "0"); trap_Cvar_Set(va("team%i_objective%i_inuse", useTeam, i), "0"); trap_Cvar_Set(va("team%i_objective%i", useTeam, i), "0"); //siege_Cvar_Set(va("siege_objective%i_mappos", i), ""); trap_Cvar_Set(va("team%i_objective%i_mappos", useTeam, i), ""); //siege_Cvar_Set(va("siege_objective%i_gfx", i), ""); trap_Cvar_Set(va("team%i_objective%i_gfx", useTeam, i), ""); //siege_Cvar_Set(va("siege_objective%i_mapicon", i), ""); trap_Cvar_Set(va("team%i_objective%i_mapicon", useTeam, i), ""); } else break; } /*else { //didn't find one, so set the "inuse" cvar to 0 for the objective and mark it non-complete. trap_Cvar_Set(va("siege_objective%i_inuse", i), "0"); trap_Cvar_Set(va("siege_objective%i", i), "0"); trap_Cvar_Set(va("team%i_objective%i_inuse", useTeam, i), "0"); trap_Cvar_Set(va("team%i_objective%i", useTeam, i), "0"); trap_Cvar_Set(va("siege_objective%i_mappos", i), ""); trap_Cvar_Set(va("team%i_objective%i_mappos", useTeam, i), ""); trap_Cvar_Set(va("siege_objective%i_gfx", i), ""); trap_Cvar_Set(va("team%i_objective%i_gfx", useTeam, i), ""); trap_Cvar_Set(va("siege_objective%i_mapicon", i), ""); trap_Cvar_Set(va("team%i_objective%i_mapicon", useTeam, i), ""); }*/ //[/SIEGECVARFIX] i++; } if (dontshow) { return; } if (BG_SiegeGetValueGroup(siege_info, teamstr, cgParseObjectives)) { if (BG_SiegeGetPairedValue(cgParseObjectives, "briefing", briefing)) { CG_DrawSiegeMessage(briefing, 1); } } }
void CG_SiegeBriefingDisplay( int team, qboolean dontShow ) { char teamstr[64] = {}; char briefing[8192] = {}; char properValue[1024] = {}; char objectiveDesc[1024] = {}; int i, useTeam = team; qboolean primary = qfalse; if ( !siege_valid ) return; if ( team == TEAM_SPECTATOR ) return; if ( team == SIEGETEAM_TEAM1 ) Com_sprintf( teamstr, sizeof(teamstr), team1 ); else Com_sprintf( teamstr, sizeof(teamstr), team2 ); if ( useTeam != SIEGETEAM_TEAM1 && useTeam != SIEGETEAM_TEAM2 ) useTeam = SIEGETEAM_TEAM2; trap->Cvar_Set( "siege_primobj_inuse", "0" ); for ( i = 1; i<16; i++ ) { //Get the value for this objective on this team //Now set the cvar for the menu to display. //primary = (CG_SiegeGetObjectiveFinal(useTeam, i)>-1)?qtrue:qfalse; primary = (CG_SiegeGetObjectiveFinal( useTeam, i ) > 0) ? qtrue : qfalse; properValue[0] = '\0'; trap->Cvar_VariableStringBuffer( va( "team%i_objective%i", useTeam, i ), properValue, sizeof(properValue) ); if ( primary ) trap->Cvar_Set( "siege_primobj", properValue ); else trap->Cvar_Set( va( "siege_objective%i", i ), properValue ); //Now set the long desc cvar for the menu to display. properValue[0] = '\0'; trap->Cvar_VariableStringBuffer( va( "team%i_objective%i_longdesc", useTeam, i ), properValue, sizeof(properValue) ); if ( primary ) trap->Cvar_Set( "siege_primobj_longdesc", properValue ); else trap->Cvar_Set( va( "siege_objective%i_longdesc", i ), properValue ); //Now set the gfx cvar for the menu to display. properValue[0] = '\0'; trap->Cvar_VariableStringBuffer( va( "team%i_objective%i_gfx", useTeam, i ), properValue, sizeof(properValue) ); if ( primary ) trap->Cvar_Set( "siege_primobj_gfx", properValue ); else trap->Cvar_Set( va( "siege_objective%i_gfx", i ), properValue ); //Now set the mapicon cvar for the menu to display. properValue[0] = '\0'; trap->Cvar_VariableStringBuffer( va( "team%i_objective%i_mapicon", useTeam, i ), properValue, sizeof(properValue) ); if ( primary ) trap->Cvar_Set( "siege_primobj_mapicon", properValue ); else trap->Cvar_Set( va( "siege_objective%i_mapicon", i ), properValue ); //Now set the mappos cvar for the menu to display. properValue[0] = '\0'; trap->Cvar_VariableStringBuffer( va( "team%i_objective%i_mappos", useTeam, i ), properValue, sizeof(properValue) ); if ( primary ) trap->Cvar_Set( "siege_primobj_mappos", properValue ); else trap->Cvar_Set( va( "siege_objective%i_mappos", i ), properValue ); //Now set the description cvar for the objective CG_SiegeGetObjectiveDescription( useTeam, i, objectiveDesc ); if ( objectiveDesc[0] ) { // found a valid objective description if ( primary ) { trap->Cvar_Set( "siege_primobj_desc", objectiveDesc ); // this one is marked not in use because it gets primobj trap->Cvar_Set( va( "siege_objective%i_inuse", i ), "0" ); trap->Cvar_Set( "siege_primobj_inuse", "1" ); trap->Cvar_Set( va( "team%i_objective%i_inuse", useTeam, i ), "1" ); } else { trap->Cvar_Set( va( "siege_objective%i_desc", i ), objectiveDesc ); trap->Cvar_Set( va( "siege_objective%i_inuse", i ), "2" ); trap->Cvar_Set( va( "team%i_objective%i_inuse", useTeam, i ), "2" ); } } else { // didn't find one, so set the "inuse" cvar to 0 for the objective and mark it non-complete. trap->Cvar_Set( va( "siege_objective%i_inuse", i ), "0" ); trap->Cvar_Set( va( "siege_objective%i", i ), "0" ); trap->Cvar_Set( va( "team%i_objective%i_inuse", useTeam, i ), "0" ); trap->Cvar_Set( va( "team%i_objective%i", useTeam, i ), "0" ); trap->Cvar_Set( va( "siege_objective%i_mappos", i ), "" ); trap->Cvar_Set( va( "team%i_objective%i_mappos", useTeam, i ), "" ); trap->Cvar_Set( va( "siege_objective%i_gfx", i ), "" ); trap->Cvar_Set( va( "team%i_objective%i_gfx", useTeam, i ), "" ); trap->Cvar_Set( va( "siege_objective%i_mapicon", i ), "" ); trap->Cvar_Set( va( "team%i_objective%i_mapicon", useTeam, i ), "" ); } } if ( dontShow ) return; if ( BG_SiegeGetValueGroup( siege_info, teamstr, cgParseObjectives ) ) { if ( BG_SiegeGetPairedValue( cgParseObjectives, "briefing", briefing ) ) CG_DrawSiegeMessage( briefing, 1 ); } }