Skip to content

Commit

Permalink
Fix mod code comments categories
Browse files Browse the repository at this point in the history
  • Loading branch information
TriForceX committed Jun 18, 2023
1 parent db2620e commit c59b74c
Show file tree
Hide file tree
Showing 21 changed files with 98 additions and 81 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,23 @@ The version control structure on this project is `<mayor>.<minor>.<patch>` where

---

## 0.19.1
- Fix jetpack idle effect on die and some tweaks
- Fix mvapi level bump ahead of jk2mv release
- Fix extra dot from kill limit message
- Fix mod version from string to integer
- Fix mod code comments categories

## 0.19.0
- Added option to enable ghost sabers
- Added message when force dimension
- Fix emote disable on duel start
- Added cvar to show motd always and bot tweaks
- Merge updates from mvsdk
- Make sp maps fixes toggleable
- Show JKA style chat lines on console
- Fix entity deletion due submodel workaround

## 0.18.3
- Fix dimension checks and validations
- Fix dual saber spinning animation
Expand Down
14 changes: 7 additions & 7 deletions code/cgame/cg_consolecmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -558,11 +558,11 @@ void CG_InitConsoleCommands( void ) {
trap_AddCommand ("loaddefered"); // spelled wrong, but not changing for demo
trap_AddCommand ("jk_ui_cmd_macroScan"); // Tr!Force: [MacroScan] Force scan of key binds to purge macros
trap_AddCommand ("jk_ui_cmd_macroEnable"); // Tr!Force: [MacroScan] Force scan of key binds to purge macros
trap_AddCommand ("emote"); // Tr!Force: [JKMod] Add command for menus
trap_AddCommand ("dropflag"); // Tr!Force: [JKMod] Add command for menus
trap_AddCommand ("engage_duel_force"); // Tr!Force: [JKMod] Add command for menus
trap_AddCommand ("jetpack"); // Tr!Force: [JKMod] Add command for menus
trap_AddCommand ("savepos"); // Tr!Force: [JKMod] Add command for menus
trap_AddCommand ("loadpos"); // Tr!Force: [JKMod] Add command for menus
trap_AddCommand ("dualsaber"); // Tr!Force: [JKMod] Add command for menus
trap_AddCommand ("emote"); // Tr!Force: [General] Add command for menus
trap_AddCommand ("dropflag"); // Tr!Force: [General] Add command for menus
trap_AddCommand ("engage_duel_force"); // Tr!Force: [General] Add command for menus
trap_AddCommand ("jetpack"); // Tr!Force: [General] Add command for menus
trap_AddCommand ("savepos"); // Tr!Force: [General] Add command for menus
trap_AddCommand ("loadpos"); // Tr!Force: [General] Add command for menus
trap_AddCommand ("dualsaber"); // Tr!Force: [General] Add command for menus
}
2 changes: 1 addition & 1 deletion code/cgame/cg_draw.c
Original file line number Diff line number Diff line change
Expand Up @@ -2651,7 +2651,7 @@ static void CG_DrawCrosshair( vec3_t worldPoint, int chEntValid ) {
return;
}

// Tr!Force: [JKMod] Don't show with movement keys at center
// Tr!Force: [General] Don't show with movement keys at center
if( jkcvar_cg_drawMovementKeys.integer == 2 && cg.snap->ps.pm_type != PM_SPECTATOR )
{
return;
Expand Down
2 changes: 1 addition & 1 deletion code/cgame/cg_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -2059,7 +2059,7 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
{
vec3_t fxDir;

if (es->generic1 == GENERIC_SERVERSIDE) break; // Tr!Force: [JKMod] Don't render serverside only
if (es->generic1 == GENERIC_SERVERSIDE) break; // Tr!Force: [General] Don't render serverside only

AngleVectors(es->angles, fxDir, 0, 0);

Expand Down
10 changes: 5 additions & 5 deletions code/cgame/cg_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ typedef struct {
int torsoAnim;

mvversion_t jk2gameplay;
// Tr!Force: [JKMod] Custom client info
// Tr!Force: [General] Custom client info
int jkmod_hat;
int jkmod_race;
int jkmod_color2;
Expand Down Expand Up @@ -652,7 +652,7 @@ typedef struct {

#define MAX_PREDICTED_EVENTS 16

#include "../../jkmod/cgame/jk_cg_local.h" // Tr!Force: [JKMod] Main header
#include "../../jkmod/cgame/jk_cg_local.h" // Tr!Force: [General] Main header

typedef struct {
int clientFrame; // incremented each frame
Expand Down Expand Up @@ -886,7 +886,7 @@ Ghoul2 Insert End

char sharedBuffer[MAX_CG_SHARED_BUFFER_SIZE];

jkmod_cg_t jkmodCG; // Tr!Force: [JKMod] Client game
jkmod_cg_t jkmodCG; // Tr!Force: [General] Client game
} cg_t;

#define MAX_TICS 14
Expand Down Expand Up @@ -1433,8 +1433,8 @@ Ghoul2 Insert End

int mvsdk_svFlags;

jkmod_cgs_t jkmodCGS; // Tr!Force: [JKMod] Client game static
jkmod_media_t jkmodMedia; // Tr!Force: [JKMod] Client media
jkmod_cgs_t jkmodCGS; // Tr!Force: [General] Client game static
jkmod_media_t jkmodMedia; // Tr!Force: [General] Client media

} cgs_t;

Expand Down
14 changes: 7 additions & 7 deletions code/cgame/cg_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -944,8 +944,8 @@ void QDECL CG_Printf( const char *msg, ... ) {
Q_vsnprintf (text, sizeof(text), msg, argptr);
va_end (argptr);

cg.jkmodCG.consolePrint++; // Tr!Force: [JKMod] Console print lines
cg.jkmodCG.consolePrintTime = cg.time; // Tr!Force: [JKMod] Console print timestamp
cg.jkmodCG.consolePrint++; // Tr!Force: [General] Console print lines
cg.jkmodCG.consolePrintTime = cg.time; // Tr!Force: [General] Console print timestamp
trap_Print( text );
}

Expand All @@ -958,8 +958,8 @@ void QDECL CG_DPrintf( const char *msg, ... ) {
Q_vsnprintf (text, sizeof(text), msg, argptr);
va_end (argptr);

cg.jkmodCG.consolePrint++; // Tr!Force: [JKMod] Console print lines
cg.jkmodCG.consolePrintTime = cg.time; // Tr!Force: [JKMod] Console print timestamp
cg.jkmodCG.consolePrint++; // Tr!Force: [General] Console print lines
cg.jkmodCG.consolePrintTime = cg.time; // Tr!Force: [General] Console print timestamp
trap_Print( text );
}
}
Expand Down Expand Up @@ -2605,7 +2605,7 @@ Ghoul2 Insert End
cgDC.Assets.qhMediumFont = trap_R_RegisterFont("ergoec");
cgDC.Assets.qhBigFont = cgDC.Assets.qhMediumFont;

trap_SP_Register("jkmod_ingame"); // Tr!Force: [JKMod] Load ingame texts
trap_SP_Register("jkmod_ingame"); // Tr!Force: [General] Load ingame texts

memset( &cgs, 0, sizeof( cgs ) );
memset( cg_weapons, 0, sizeof(cg_weapons) );
Expand Down Expand Up @@ -2786,9 +2786,9 @@ Ghoul2 Insert End

CG_RegisterGraphics();

CG_LoadingString( "client plugin" ); // Tr!Force: [JKMod] Register media
CG_LoadingString( "client plugin" ); // Tr!Force: [General] Register media

JKMod_CG_RegisterMedia(); // Tr!Force: [JKMod] Register media
JKMod_CG_RegisterMedia(); // Tr!Force: [General] Register media

CG_LoadingString( "clients" );

Expand Down
4 changes: 2 additions & 2 deletions code/cgame/cg_players.c
Original file line number Diff line number Diff line change
Expand Up @@ -1182,7 +1182,7 @@ void CG_NewClientInfo( int clientNum, qboolean entitiesInitialized ) {
MV_SetGamePlay( newInfo.jk2gameplay );
}

// Tr!Force: [JKMod] Custom client info
// Tr!Force: [General] Custom client info
v = Info_ValueForKey( configstring, "jkhat" );
newInfo.jkmod_hat = atoi(v);

Expand Down Expand Up @@ -3440,7 +3440,7 @@ static void CG_PlayerSprites( centity_t *cent ) {
return; //this entity is mind-tricking the current client, so don't render it
}

// Tr!Force: [JKMod] Don't show on emote menu
// Tr!Force: [General] Don't show on emote menu
if ( JKMod_CG_EmoteUI() ) return;

if ( cent->currentState.eFlags & EF_CONNECTION && cg_drawPlayerSprites.integer & 1 ) {
Expand Down
4 changes: 2 additions & 2 deletions code/cgame/cg_servercmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -1275,7 +1275,7 @@ static void CG_ServerCommand( void ) {
if ( !strcmp( cmd, "print" ) ) {
char strEd[MAX_STRIPED_SV_STRING];
CG_CheckSVStripEdRef(strEd, CG_Argv(1));
if (strstr(strEd, "This server is running JK2MV")) return; // Tr!Force: [JKMod] Skip JK2MV message
if (strstr(strEd, "This server is running JK2MV")) return; // Tr!Force: [General] Skip JK2MV message
CG_Printf( "%s", strEd );
return;
}
Expand Down Expand Up @@ -1385,7 +1385,7 @@ static void CG_ServerCommand( void ) {
return;
}

// Tr!Force: [JKMod] Toggle console from server
// Tr!Force: [General] Toggle console from server
if ( !strcmp(cmd, "jk_cg_toggleConsole") )
{
if (trap_Key_GetCatcher() & KEYCATCH_CONSOLE) {
Expand Down
2 changes: 1 addition & 1 deletion code/cgame/cg_view.c
Original file line number Diff line number Diff line change
Expand Up @@ -1716,7 +1716,7 @@ void CG_DrawActiveFrame( int serverTime, stereoFrame_t stereoView, qboolean demo
{ //always force first person when zoomed
cg.renderingThirdPerson = 0;
}
// Tr!Force: [JKMod] Check emote camera
// Tr!Force: [General] Check emote camera
else if (cg.jkmodCG.emoteCamera)
{
cg.renderingThirdPerson = 1;
Expand Down
4 changes: 2 additions & 2 deletions code/game/bg_public.h
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ typedef enum {
STAT_DEAD_YAW, // look this direction when dead (FIXME: get rid of?)
STAT_CLIENTS_READY, // bit mask of clients wishing to exit the intermission (FIXME: configstring?)
STAT_MAX_HEALTH, // health / armor limit, changable by handicap
// Tr!Force: [JKMod] Custom stats data
// Tr!Force: [General] Custom stats data
JK_PLAYER,
JK_DIMENSION,
JK_MOVEMENT,
Expand Down Expand Up @@ -401,7 +401,7 @@ typedef enum {
#define EF_DISINTEGRATION 0x02000000 // being disintegrated by the disruptor
#define EF_INVULNERABLE 0x04000000 // just spawned in or whatever, so is protected

#include "../../jkmod/game/jk_public.h" // Tr!Force: [JKMod] Public header
#include "../../jkmod/game/jk_public.h" // Tr!Force: [General] Public header

typedef enum {
EFFECT_NONE = 0,
Expand Down
6 changes: 3 additions & 3 deletions code/game/g_active.c
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ qboolean ClientInactivityTimer( gclient_t *client ) {
}
if ( level.time > client->inactivityTime - 10000 && !client->inactivityWarning ) {
client->inactivityWarning = qtrue;
trap_SendServerCommand( client - level.clients, "cp \"Ten seconds until inactivity drop!\"" ); // Workaround
trap_SendServerCommand( client - level.clients, "cp \"Ten seconds until inactivity drop!\"" ); // Tr!Force: [BaseJK] Workaround
}
}
return qtrue;
Expand Down Expand Up @@ -705,7 +705,7 @@ void ClientTimerActions( gentity_t *ent, int msec ) {
client->ps.stats[STAT_ARMOR]--;
}

// Tr!Force: [JKMod] Launch custom client timer actions
// Tr!Force: [General] Launch custom client timer actions
JKMod_ClientTimerActions(ent, msec);
}
}
Expand Down Expand Up @@ -1126,7 +1126,7 @@ void BaseJK2_ClientThink_real( gentity_t *ent ) { // Tr!Force: [BaseJK2] Client
}
}

if (client->pers.jkmodPers.customSettings) // Tr!Force: [JKMod] Apply custom settings
if (client->pers.jkmodPers.customSettings) // Tr!Force: [General] Apply custom settings
{
client->ps.gravity = client->pers.jkmodPers.customGravity;

Expand Down
42 changes: 21 additions & 21 deletions code/game/g_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -1136,8 +1136,8 @@ void ClientUserinfoChanged( int clientNum ) {
char redTeam[MAX_INFO_STRING];
char blueTeam[MAX_INFO_STRING];
char userinfo[MAX_INFO_STRING];
int jkmod_hat; // Tr!Force: [JKMod] Custom client info
int jkmod_race; // Tr!Force: [JKMod] Custom client info
int jkmod_hat; // Tr!Force: [General] Custom client info
int jkmod_race; // Tr!Force: [General] Custom client info

// NameCrashFix (whitelisted characters)
static const char validChars[] = " ~QqWwEeRrTtYyUuIiOoPpAaSsDdFfGgHhJjKkLlZzXxCcVvBbNnMm1234567890<>?,./';:][{}`-=!@#$^&*()_+| ";
Expand Down Expand Up @@ -1234,7 +1234,7 @@ void ClientUserinfoChanged( int clientNum ) {
ptr = strstr( s, "@@@" );
}

JKMod_ClientCleanName( s, ent->client->pers.netname, sizeof(ent->client->pers.netname), ent); // Tr!Force: [JKMod] Client clean name
JKMod_ClientCleanName( s, ent->client->pers.netname, sizeof(ent->client->pers.netname), ent); // Tr!Force: [General] Client clean name
Info_RemoveKey( userinfo, "name" );
Info_SetValueForKey( userinfo, "name", ent->client->pers.netname );
trap_SetUserinfo( clientNum, userinfo );
Expand Down Expand Up @@ -1327,15 +1327,15 @@ void ClientUserinfoChanged( int clientNum ) {
}
*/

// Tr!Force: [JKMod] Custom user info
// Tr!Force: [General] Custom user info
s = Info_ValueForKey( userinfo, "jk_cg_customHats" );
if ( ! *s || atoi( s ) != 0 ) {
jkmod_hat = atoi( s );
} else {
jkmod_hat = 0;
}

// Tr!Force: [JKMod] Custom user info
// Tr!Force: [General] Custom user info
jkmod_race = client->pers.jkmodPers.raceBestTime;

// team task (0 = none, 1 = offence, 2 = defence)
Expand All @@ -1357,15 +1357,15 @@ void ClientUserinfoChanged( int clientNum ) {
client->pers.netname, team, model, c1, c2,
client->pers.maxHealth, client->sess.wins, client->sess.losses,
Info_ValueForKey( userinfo, "skill" ), teamTask, teamLeader, jk2gameplay,
// Tr!Force: [JKMod] Custom user info
// Tr!Force: [General] Custom user info
jkmod_hat,
jkmod_race
);
} else {
s = va("n\\%s\\t\\%i\\model\\%s\\g_redteam\\%s\\g_blueteam\\%s\\c1\\%s\\c2\\%s\\hc\\%i\\w\\%i\\l\\%i\\tt\\%d\\tl\\%d\\mvgp\\%i\\jkhat\\%i\\jkrace\\%i",
client->pers.netname, client->sess.sessionTeam, model, redTeam, blueTeam, c1, c2,
client->pers.maxHealth, client->sess.wins, client->sess.losses, teamTask, teamLeader, jk2gameplay,
// Tr!Force: [JKMod] Custom user info
// Tr!Force: [General] Custom user info
jkmod_hat,
jkmod_race
);
Expand Down Expand Up @@ -1610,9 +1610,9 @@ void BaseJK2_ClientBegin( int clientNum, qboolean allowTeamReset ) { // Tr!Force
gentity_t *tent;
int flags, i;
char userinfo[MAX_INFO_VALUE], *modelname;
int jksave_player; // Tr!Force: [JKMod] Don't remove flags
int jksave_player; // Tr!Force: [General] Don't remove flags
int jksave_dimension; // Tr!Force: [Dimensions] Don't remove flags
int jksave_movement; // Tr!Force: [JKMod] Don't remove flags
int jksave_movement; // Tr!Force: [General] Don't remove flags

ent = g_entities + clientNum;

Expand Down Expand Up @@ -1707,9 +1707,9 @@ void BaseJK2_ClientBegin( int clientNum, qboolean allowTeamReset ) { // Tr!Force
// world to the new position
flags = client->ps.eFlags;

jksave_player = client->ps.stats[JK_PLAYER]; // Tr!Force: [JKMod] Don't remove flags
jksave_player = client->ps.stats[JK_PLAYER]; // Tr!Force: [General] Don't remove flags
jksave_dimension = client->ps.stats[JK_DIMENSION]; // Tr!Force: [Dimensions] Don't remove flags
jksave_movement = client->ps.stats[JK_MOVEMENT]; // Tr!Force: [JKMod] Don't remove flags
jksave_movement = client->ps.stats[JK_MOVEMENT]; // Tr!Force: [General] Don't remove flags

i = 0;

Expand Down Expand Up @@ -1737,9 +1737,9 @@ void BaseJK2_ClientBegin( int clientNum, qboolean allowTeamReset ) { // Tr!Force
memset( &client->ps, 0, sizeof( client->ps ) );
client->ps.eFlags = flags;

client->ps.stats[JK_PLAYER] = jksave_player; // Tr!Force: [JKMod] Don't remove flags
client->ps.stats[JK_PLAYER] = jksave_player; // Tr!Force: [General] Don't remove flags
client->ps.stats[JK_DIMENSION] = jksave_dimension; // Tr!Force: [Dimensions] Don't remove flags
client->ps.stats[JK_MOVEMENT] = jksave_movement; // Tr!Force: [JKMod] Don't remove flags
client->ps.stats[JK_MOVEMENT] = jksave_movement; // Tr!Force: [General] Don't remove flags

client->ps.hasDetPackPlanted = qfalse;

Expand Down Expand Up @@ -1835,9 +1835,9 @@ void ClientSpawn(gentity_t *ent) {
void *ghoul2save;
int saveSaberNum = ENTITYNUM_NONE;
int wDisable = 0;
int jksave_player; // Tr!Force: [JKMod] Don't remove flags
int jksave_player; // Tr!Force: [General] Don't remove flags
int jksave_dimension; // Tr!Force: [Dimensions] Don't remove flags
int jksave_movement; // Tr!Force: [JKMod] Don't remove flags
int jksave_movement; // Tr!Force: [General] Don't remove flags

index = ent - g_entities;
client = ent->client;
Expand Down Expand Up @@ -1945,15 +1945,15 @@ void ClientSpawn(gentity_t *ent) {

saveSaberNum = client->ps.saberEntityNum;

jksave_player = client->ps.stats[JK_PLAYER]; // Tr!Force: [JKMod] Don't remove flags
jksave_player = client->ps.stats[JK_PLAYER]; // Tr!Force: [General] Don't remove flags
jksave_dimension = client->ps.stats[JK_DIMENSION]; // Tr!Force: [Dimensions] Don't remove flags
jksave_movement = client->ps.stats[JK_MOVEMENT]; // Tr!Force: [JKMod] Don't remove flags
jksave_movement = client->ps.stats[JK_MOVEMENT]; // Tr!Force: [General] Don't remove flags

memset (client, 0, sizeof(*client)); // bk FIXME: Com_Memset?

client->ps.stats[JK_PLAYER] = jksave_player; // Tr!Force: [JKMod] Don't remove flags
client->ps.stats[JK_PLAYER] = jksave_player; // Tr!Force: [General] Don't remove flags
client->ps.stats[JK_DIMENSION] = jksave_dimension; // Tr!Force: [Dimensions] Don't remove flags
client->ps.stats[JK_MOVEMENT] = jksave_movement; // Tr!Force: [JKMod] Don't remove flags
client->ps.stats[JK_MOVEMENT] = jksave_movement; // Tr!Force: [General] Don't remove flags

//rww - Don't wipe the ghoul2 instance or the animation data
client->ghoul2 = ghoul2save;
Expand Down Expand Up @@ -2470,10 +2470,10 @@ void ClientDisconnect( int clientNum ) {
// Tr!Force: [Emotes] Chair emote disable
if (ent->client->jkmodClient.chairModelUsed) JKMod_ChairModelDisable(ent);

// Tr!Force: [JKMod] Check for reconnect
// Tr!Force: [General] Check for reconnect
Q_strncpyz(level.jkmodLocals.reconnectedIP, ent->client->sess.jkmodSess.clientIP, sizeof(level.jkmodLocals.reconnectedIP));

// Tr!Force: [JKMod] Clear ignored client
// Tr!Force: [General] Clear ignored client
JKMod_IgnoreClientClear(clientNum);

trap_SetConfigstring( CS_PLAYERS + clientNum, "");
Expand Down
6 changes: 3 additions & 3 deletions code/game/g_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ Let everyone know about a team change
*/
void BroadcastTeamChange( gclient_t *client, int oldTeam )
{
// Tr!Force: [JKMod] Clear map restarted
// Tr!Force: [General] Clear map restarted
if (level.jkmodLocals.mapRestarted) level.jkmodLocals.mapRestarted = qfalse;

client->ps.fd.forceDoInit = 1; //every time we change teams make sure our force powers are set right
Expand Down Expand Up @@ -858,7 +858,7 @@ void StopFollowing( gentity_t *ent ) {
ent->client->ps.clientNum = ent - g_entities;
ent->client->ps.weapon = WP_NONE;

// Workaround
// Tr!Force: [BaseJK] Workaround
ent->client->ps.duelInProgress = qfalse;
ent->client->ps.zoomMode = 0;
memset(ent->client->ps.powerups, 0, sizeof(ent->client->ps.powerups));
Expand Down Expand Up @@ -1509,7 +1509,7 @@ Cmd_Where_f
==================
*/
void Cmd_Where_f( gentity_t *ent ) {
trap_SendServerCommand( ent-g_entities, va("print \"%s\n\"", vtos( ent->client->ps.origin ) ) ); // Workaround
trap_SendServerCommand( ent-g_entities, va("print \"%s\n\"", vtos( ent->client->ps.origin ) ) ); // Tr!Force: [BaseJK] Workaround
}

static const char *gameNames[] = {
Expand Down
Loading

0 comments on commit c59b74c

Please sign in to comment.