From 41c691b67c547f3f8120e5b819a6c6c0fb32155d Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Tue, 13 Aug 2019 21:56:17 -0500 Subject: [PATCH 1/6] mint-arena: Fix select order for joystick analog in controls menu Keyboard arrow key selection order for joystick analog and threshhold settings were reversed. --- code/q3_ui/ui_controls2.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/code/q3_ui/ui_controls2.c b/code/q3_ui/ui_controls2.c index b5a9f3e82..3ef767cf1 100644 --- a/code/q3_ui/ui_controls2.c +++ b/code/q3_ui/ui_controls2.c @@ -129,8 +129,8 @@ enum { ID_AUTOSWITCH, ID_MOUSESPEED, ID_SELECTJOY, - ID_JOYANALOG, ID_JOYTHRESHOLD, + ID_JOYANALOG, ID_SMOOTHMOUSE }; @@ -234,8 +234,8 @@ typedef struct menuaction_s togglemenu; menutext_s selectjoy; - menuradiobutton_s joyanalog; menuslider_s joythreshold; + menuradiobutton_s joyanalog; int section; char playerModel[MAX_QPATH]; char playerHead[MAX_QPATH]; @@ -1044,8 +1044,8 @@ static void Controls_GetConfig( void ) s_controls.alwaysrun.curvalue = Com_Clamp( 0, 1, Controls_GetCvarValue( Com_LocalPlayerCvarName(s_controls.localPlayerNum, "cl_run" ) ) ); s_controls.cyclepastgauntlet.curvalue = Com_Clamp( 0, 1, Controls_GetCvarValue( Com_LocalPlayerCvarName(s_controls.localPlayerNum, "cg_cyclePastGauntlet" ) ) ); s_controls.autoswitch.curvalue = Com_Clamp( 0, 1, Controls_GetCvarValue( Com_LocalPlayerCvarName(s_controls.localPlayerNum, "cg_autoswitch" ) ) ); - s_controls.joyanalog.curvalue = Com_Clamp( 0, 1, Controls_GetCvarValue( Com_LocalPlayerCvarName(s_controls.localPlayerNum, "in_joystickUseAnalog" ) ) ); s_controls.joythreshold.curvalue = Com_Clamp( 0.05f, 0.75f, Controls_GetCvarValue( Com_LocalPlayerCvarName(s_controls.localPlayerNum, "in_joystickThreshold" ) ) ); + s_controls.joyanalog.curvalue = Com_Clamp( 0, 1, Controls_GetCvarValue( Com_LocalPlayerCvarName(s_controls.localPlayerNum, "in_joystickUseAnalog" ) ) ); } /* @@ -1093,8 +1093,8 @@ static void Controls_SetConfig( void ) trap_Cvar_SetValue( Com_LocalPlayerCvarName( s_controls.localPlayerNum, "cl_run" ), s_controls.alwaysrun.curvalue ); trap_Cvar_SetValue( Com_LocalPlayerCvarName( s_controls.localPlayerNum, "cg_cyclePastGauntlet" ), s_controls.cyclepastgauntlet.curvalue ); trap_Cvar_SetValue( Com_LocalPlayerCvarName( s_controls.localPlayerNum, "cg_autoswitch" ), s_controls.autoswitch.curvalue ); - trap_Cvar_SetValue( Com_LocalPlayerCvarName( s_controls.localPlayerNum, "in_joystickUseAnalog" ), s_controls.joyanalog.curvalue ); trap_Cvar_SetValue( Com_LocalPlayerCvarName( s_controls.localPlayerNum, "in_joystickThreshold" ), s_controls.joythreshold.curvalue ); + trap_Cvar_SetValue( Com_LocalPlayerCvarName( s_controls.localPlayerNum, "in_joystickUseAnalog" ), s_controls.joyanalog.curvalue ); } /* @@ -1132,8 +1132,8 @@ static void Controls_SetDefaults( void ) s_controls.autoswitch.curvalue = Controls_GetCvarDefault( Com_LocalPlayerCvarName(s_controls.localPlayerNum, "cg_autoswitch" ) ); trap_Cvar_SetValue(Com_LocalPlayerCvarName(s_controls.localPlayerNum, "in_joystick"), 0); trap_Cvar_SetValue(Com_LocalPlayerCvarName(s_controls.localPlayerNum, "in_joystickNo"), 0); - s_controls.joyanalog.curvalue = Controls_GetCvarDefault( Com_LocalPlayerCvarName(s_controls.localPlayerNum, "in_joystickUseAnalog" ) ); s_controls.joythreshold.curvalue = Controls_GetCvarDefault( Com_LocalPlayerCvarName(s_controls.localPlayerNum, "in_joystickThreshold" ) ); + s_controls.joyanalog.curvalue = Controls_GetCvarDefault( Com_LocalPlayerCvarName(s_controls.localPlayerNum, "in_joystickUseAnalog" ) ); } /* @@ -1410,8 +1410,8 @@ static void Controls_MenuEvent( void* ptr, int event ) case ID_ALWAYSRUN: case ID_CYCLEPASTGAUNTLET: case ID_AUTOSWITCH: - case ID_JOYANALOG: case ID_JOYTHRESHOLD: + case ID_JOYANALOG: if (event == QM_ACTIVATED) { s_controls.changesmade = qtrue; @@ -1919,14 +1919,6 @@ static void Controls_MenuInit( int localPlayerNum ) s_controls.selectjoy.color = text_color_normal; s_controls.selectjoy.style = UI_RIGHT|UI_SMALLFONT; - s_controls.joyanalog.generic.type = MTYPE_RADIOBUTTON; - s_controls.joyanalog.generic.flags = QMF_SMALLFONT; - s_controls.joyanalog.generic.x = SCREEN_WIDTH/2; - s_controls.joyanalog.generic.name = "analog input"; - s_controls.joyanalog.generic.id = ID_JOYANALOG; - s_controls.joyanalog.generic.callback = Controls_MenuEvent; - s_controls.joyanalog.generic.statusbar = Controls_StatusBar; - s_controls.joythreshold.generic.type = MTYPE_SLIDER; s_controls.joythreshold.generic.x = SCREEN_WIDTH/2; s_controls.joythreshold.generic.flags = QMF_SMALLFONT; @@ -1937,6 +1929,14 @@ static void Controls_MenuInit( int localPlayerNum ) s_controls.joythreshold.maxvalue = 0.75f; s_controls.joythreshold.generic.statusbar = Controls_StatusBar; + s_controls.joyanalog.generic.type = MTYPE_RADIOBUTTON; + s_controls.joyanalog.generic.flags = QMF_SMALLFONT; + s_controls.joyanalog.generic.x = SCREEN_WIDTH/2; + s_controls.joyanalog.generic.name = "analog input"; + s_controls.joyanalog.generic.id = ID_JOYANALOG; + s_controls.joyanalog.generic.callback = Controls_MenuEvent; + s_controls.joyanalog.generic.statusbar = Controls_StatusBar; + s_controls.name.generic.type = MTYPE_PTEXT; s_controls.name.generic.flags = QMF_CENTER_JUSTIFY|QMF_INACTIVE; s_controls.name.generic.x = 320; @@ -1967,8 +1967,8 @@ static void Controls_MenuInit( int localPlayerNum ) Menu_AddItem( &s_controls.menu, &s_controls.centerview ); Menu_AddItem( &s_controls.menu, &s_controls.zoomview ); Menu_AddItem( &s_controls.menu, &s_controls.selectjoy ); - Menu_AddItem( &s_controls.menu, &s_controls.joyanalog ); Menu_AddItem( &s_controls.menu, &s_controls.joythreshold ); + Menu_AddItem( &s_controls.menu, &s_controls.joyanalog ); Menu_AddItem( &s_controls.menu, &s_controls.alwaysrun ); Menu_AddItem( &s_controls.menu, &s_controls.run ); From e38b3aa6ad5161b5a4e0f0aa8b483ed0a6773ed0 Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Tue, 13 Aug 2019 22:46:02 -0500 Subject: [PATCH 2/6] mint-arena: Change console to use font actually included with Spearmint --- code/cgame/cg_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/cgame/cg_main.c b/code/cgame/cg_main.c index 8edb00c0e..4c2b9b104 100644 --- a/code/cgame/cg_main.c +++ b/code/cgame/cg_main.c @@ -515,7 +515,7 @@ static cvarTable_t cgameCvarTable[] = { { &cg_forceBitmapFonts, "cg_forceBitmapFonts", "0", CVAR_ARCHIVE | CVAR_LATCH, RANGE_BOOL }, { &cg_drawGrappleHook, "cg_drawGrappleHook", "1", CVAR_ARCHIVE, RANGE_BOOL }, { &cg_drawBBox, "cg_drawBBox", "0", CVAR_CHEAT, RANGE_BOOL }, - { &cg_consoleFont, "cg_consoleFont", "fonts/LiberationMono-Bold.ttf", CVAR_ARCHIVE | CVAR_LATCH, RANGE_ALL }, + { &cg_consoleFont, "cg_consoleFont", "fonts/LiberationMono-Regular.ttf", CVAR_ARCHIVE | CVAR_LATCH, RANGE_ALL }, { &cg_consoleFontSize, "cg_consoleFontSize", "8", CVAR_ARCHIVE | CVAR_LATCH, RANGE_INT( 4, 24 ) }, { &cg_hudFont, "cg_hudFont", "fonts/LiberationSans-Bold.ttf", CVAR_ARCHIVE | CVAR_LATCH, RANGE_ALL }, { &cg_hudFontBorder, "cg_hudFontBorder", "2", CVAR_ARCHIVE | CVAR_LATCH, RANGE_FLOAT( 0, 10 ) }, From 8395beb4a9c772a71ff85682f302c2e949d7036e Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Fri, 11 Oct 2019 20:04:03 -0500 Subject: [PATCH 3/6] mint-arena: Fix third person lightning bolt without weapon model Lightning bolt for world/third person player model when missing weapon model was only added if the local player was firing but should be added if the player entity is firing. (It was copy-paste error from first person view weapon code.) --- code/cgame/cg_weapons.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/cgame/cg_weapons.c b/code/cgame/cg_weapons.c index 0baef59df..27ba08a7b 100644 --- a/code/cgame/cg_weapons.c +++ b/code/cgame/cg_weapons.c @@ -1252,7 +1252,7 @@ void CG_AddPlayerWeapon( refEntity_t *parent, playerState_t *ps, centity_t *cent VectorCopy( nonPredictedCent->pe.flashOrigin, flash.origin ); } - if ( ( cg.cur_lc->predictedPlayerState.eFlags & EF_FIRING ) + if ( ( nonPredictedCent->currentState.eFlags & EF_FIRING ) && ( ps || cg.cur_lc->renderingThirdPerson || cent->currentState.number != cg.cur_lc->predictedPlayerState.playerNum ) ) { // special hack for lightning gun... From 5395d023d8691d7848f8a8aa37139caa00a57b5a Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Fri, 11 Oct 2019 20:41:28 -0500 Subject: [PATCH 4/6] mint-arena: Fix lightning trail being fired from corpses The lightning trail is fired from the real non-predicted entity for the local client so it can show the server location. The real client entity was always used to check if a player entity is firing the lighting gun. This potentially causes corpses and players on single player podiums with lightning gun or missing weapon model to render the lightning trail if the real (living) client is firing the lightning gun. This is an issue for corpses as they have WP_NONE and thus always missing the weapon model. It's not an issue for podium players as it's not possible to fire during intermission. Note: This was committed to ioquake3, which doesn't draw lightning if missing weapon model, as "Fix lightning gun handling for corpses and single player podiums". --- code/cgame/cg_weapons.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/code/cgame/cg_weapons.c b/code/cgame/cg_weapons.c index 27ba08a7b..aaa761d20 100644 --- a/code/cgame/cg_weapons.c +++ b/code/cgame/cg_weapons.c @@ -1230,7 +1230,11 @@ void CG_AddPlayerWeapon( refEntity_t *parent, playerState_t *ps, centity_t *cent } // make sure we aren't looking at cg.cur_lc->predictedPlayerEntity for LG - nonPredictedCent = &cg_entities[cent->currentState.playerNum]; + if ( cent == &cg.cur_lc->predictedPlayerEntity ) { + nonPredictedCent = &cg_entities[cent->currentState.playerNum]; + } else { + nonPredictedCent = cent; + } if ( !weapon->weaponModel || !weapon->flashModel ) { // use default flash origin when no flash model @@ -1314,13 +1318,6 @@ void CG_AddPlayerWeapon( refEntity_t *parent, playerState_t *ps, centity_t *cent CG_AddWeaponWithPowerups( &barrel, cent->currentState.powerups ); } - // if the index of the nonPredictedCent is not the same as the playerNum - // then this is a fake player (like on the single player podiums), so - // go ahead and use the cent - if( ( nonPredictedCent - cg_entities ) != cent->currentState.playerNum ) { - nonPredictedCent = cent; - } - memset( &flash, 0, sizeof( flash ) ); VectorCopy( parent->lightingOrigin, flash.lightingOrigin ); flash.shadowPlane = parent->shadowPlane; From 95c184ea338d0248eb360ac5b4951cdc5f2733db Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Mon, 28 Oct 2019 23:25:05 -0500 Subject: [PATCH 5/6] Fix team orders menu not listing clients with lower clientnums If bots join before the local client (dedicated server) the bots would not be listed in the Q3A team orders menu and so they could not be given orders using the menu. The Q3A team orders menu got local client's team while looping through all clients. Ignoring any bots with clientnum lower than the local client. Get local client's team before the loop so all bots are listed. --- code/q3_ui/ui_teamorders.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/code/q3_ui/ui_teamorders.c b/code/q3_ui/ui_teamorders.c index 82c174307..deb125f5c 100644 --- a/code/q3_ui/ui_teamorders.c +++ b/code/q3_ui/ui_teamorders.c @@ -393,7 +393,7 @@ static void UI_TeamOrdersMenu_BuildBotList( void ) { int numPlayers; int isBot; int n; - char playerTeam = '3'; + char playerTeam; char botTeam; char info[MAX_INFO_STRING]; @@ -408,14 +408,16 @@ static void UI_TeamOrdersMenu_BuildBotList( void ) { numPlayers = atoi( Info_ValueForKey( info, "sv_maxclients" ) ); teamOrdersMenuInfo.gametype = atoi( Info_ValueForKey( info, "g_gametype" ) ); - for( n = 0; n < numPlayers && teamOrdersMenuInfo.numBots < 9; n++ ) { - trap_GetConfigString( CS_PLAYERS + n, info, MAX_INFO_STRING ); + trap_GetConfigString( CS_PLAYERS + cg.localPlayers[0].playerNum, info, MAX_INFO_STRING ); + playerTeam = *Info_ValueForKey( info, "t" ); + for( n = 0; n < numPlayers && teamOrdersMenuInfo.numBots < 9; n++ ) { if( n == cg.localPlayers[0].playerNum ) { - playerTeam = *Info_ValueForKey( info, "t" ); continue; } + trap_GetConfigString( CS_PLAYERS + n, info, MAX_INFO_STRING ); + isBot = atoi( Info_ValueForKey( info, "skill" ) ); if( !isBot ) { continue; From 34320156df2b6c34f36e55d3688ce409bb86d3da Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Sun, 3 Nov 2019 15:25:03 -0600 Subject: [PATCH 6/6] mint-arena: Change version to 1.0.2 --- Makefile | 2 +- code/game/bg_public.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 7112bb475..f981b8c65 100644 --- a/Makefile +++ b/Makefile @@ -98,7 +98,7 @@ endif export CROSS_COMPILING ifndef VERSION -VERSION=1.0.1 +VERSION=1.0.2 endif ifndef VM_PREFIX diff --git a/code/game/bg_public.h b/code/game/bg_public.h index eb065304b..4e769a286 100644 --- a/code/game/bg_public.h +++ b/code/game/bg_public.h @@ -44,7 +44,7 @@ Suite 120, Rockville, Maryland 20850 USA. // Keep this in-sync with VERSION in Makefile. #ifndef PRODUCT_VERSION - #define PRODUCT_VERSION "1.0.1" + #define PRODUCT_VERSION "1.0.2" #endif // because games can change separately from the main system protocol, we need a