From 78b239381e77e123f4609a464ab2b5b783210102 Mon Sep 17 00:00:00 2001 From: videoP Date: Tue, 2 Apr 2024 15:47:32 -0400 Subject: [PATCH 1/3] typo fix (cherry picked from commit 90b95e5787274e520ddbed4f9cbe98e12c94313f) --- codemp/game/g_cmds.c | 2 +- codemp/game/g_items.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/codemp/game/g_cmds.c b/codemp/game/g_cmds.c index 239ef80179..bf97c26e6c 100644 --- a/codemp/game/g_cmds.c +++ b/codemp/game/g_cmds.c @@ -6691,7 +6691,7 @@ static void Cmd_MovementStyle_f(gentity_t *ent) return; if (trap->Argc() != 2) { - trap->SendServerCommand( ent-g_entities, "print \"Usage: /move .\n\"" ); + trap->SendServerCommand( ent-g_entities, "print \"Usage: /move .\n\"" ); return; } diff --git a/codemp/game/g_items.c b/codemp/game/g_items.c index 1e8418e6c2..04fb49ea36 100644 --- a/codemp/game/g_items.c +++ b/codemp/game/g_items.c @@ -2270,7 +2270,7 @@ int Pickup_Ammo (gentity_t *ent, gentity_t *other) other->client->ps.ammo[AMMO_THERMAL] = 2; other->client->ps.ammo[AMMO_TRIPMINE] = 2; - if (other->health < other->client->ps.stats[STAT_MAX_HEALTH]) { + if (other->health > 0 && other->health < other->client->ps.stats[STAT_MAX_HEALTH]) { other->client->passiveHealthDebReduce = level.time; //Passif regen if (other->client->pers.tribesClass == 1) { other->health += 250; From 40cee9fc234e172f7ad8a6bd1affff67c5531e85 Mon Sep 17 00:00:00 2001 From: SomaZ <17459161+somaz@users.noreply.github.com> Date: Fri, 5 Apr 2024 03:41:23 +0800 Subject: [PATCH 2/3] [rend2] Fix some compiler warnings Mostly unused variables --- shared/rd-rend2/tr_animation.cpp | 3 ++- shared/rd-rend2/tr_backend.cpp | 4 ++-- shared/rd-rend2/tr_cache.cpp | 1 + shared/rd-rend2/tr_ghoul2.cpp | 3 ++- shared/rd-rend2/tr_main.cpp | 3 ++- shared/rd-rend2/tr_mesh.cpp | 4 ++-- 6 files changed, 11 insertions(+), 7 deletions(-) diff --git a/shared/rd-rend2/tr_animation.cpp b/shared/rd-rend2/tr_animation.cpp index fcde1de1da..1946872f53 100644 --- a/shared/rd-rend2/tr_animation.cpp +++ b/shared/rd-rend2/tr_animation.cpp @@ -136,7 +136,7 @@ R_MDRComputeFogNum */ int R_MDRComputeFogNum( mdrHeader_t *header, trRefEntity_t *ent ) { - int i, j; + int i; float frameRadius; fog_t *fog; mdrFrame_t *mdrFrame; @@ -154,6 +154,7 @@ int R_MDRComputeFogNum( mdrHeader_t *header, trRefEntity_t *ent ) { VectorAdd( ent->e.origin, mdrFrame->localOrigin, localOrigin ); frameRadius = mdrFrame->radius; #ifndef REND2_SP + int j; for (i = 1; i < tr.world->numfogs; i++) { fog = &tr.world->fogs[i]; for (j = 0; j < 3; j++) { diff --git a/shared/rd-rend2/tr_backend.cpp b/shared/rd-rend2/tr_backend.cpp index 17b3701cb2..e5cae81890 100644 --- a/shared/rd-rend2/tr_backend.cpp +++ b/shared/rd-rend2/tr_backend.cpp @@ -2147,7 +2147,7 @@ static void RB_RenderMainPass( drawSurf_t *drawSurfs, int numDrawSurfs ) if (r_drawSun->integer) { - RB_DrawSun(0.1, tr.sunShader); + RB_DrawSun(0.1f, tr.sunShader); } if (r_drawSunRays->integer) @@ -2161,7 +2161,7 @@ static void RB_RenderMainPass( drawSurf_t *drawSurfs, int numDrawSurfs ) tr.sunFlareQueryActive[tr.sunFlareQueryIndex] = qtrue; qglBeginQuery(GL_SAMPLES_PASSED, tr.sunFlareQuery[tr.sunFlareQueryIndex]); - RB_DrawSun(0.3, tr.sunFlareShader); + RB_DrawSun(0.3f, tr.sunFlareShader); qglEndQuery(GL_SAMPLES_PASSED); diff --git a/shared/rd-rend2/tr_cache.cpp b/shared/rd-rend2/tr_cache.cpp index 76e74e1252..a1d89de26f 100644 --- a/shared/rd-rend2/tr_cache.cpp +++ b/shared/rd-rend2/tr_cache.cpp @@ -185,6 +185,7 @@ void CModelCacheManager::DumpNonPure( void ) int iInPak = ri.FS_FileIsInPAK( it->path, &iChecksum ); #else int iInPak = ri.FS_FileIsInPAK(it->path); + iChecksum = it->iPAKChecksum; #endif if( iInPak == -1 || iChecksum != it->iPAKChecksum ) diff --git a/shared/rd-rend2/tr_ghoul2.cpp b/shared/rd-rend2/tr_ghoul2.cpp index 2ac9ac72a7..0a7d0d7c28 100644 --- a/shared/rd-rend2/tr_ghoul2.cpp +++ b/shared/rd-rend2/tr_ghoul2.cpp @@ -925,7 +925,7 @@ R_AComputeFogNum */ static int R_GComputeFogNum( trRefEntity_t *ent ) { - int i, j; + int i; float frameRadius; fog_t *fog; vec3_t localOrigin; @@ -937,6 +937,7 @@ static int R_GComputeFogNum( trRefEntity_t *ent ) { VectorCopy(ent->e.origin, localOrigin); frameRadius = ent->e.radius; #ifndef REND2_SP + int j; for ( i = 1 ; i < tr.world->numfogs ; i++ ) { fog = &tr.world->fogs[i]; for ( j = 0 ; j < 3 ; j++ ) { diff --git a/shared/rd-rend2/tr_main.cpp b/shared/rd-rend2/tr_main.cpp index 94bdbac4f2..6ffe05359e 100644 --- a/shared/rd-rend2/tr_main.cpp +++ b/shared/rd-rend2/tr_main.cpp @@ -1654,7 +1654,7 @@ See if a sprite is inside a fog volume ================= */ int R_SpriteFogNum( trRefEntity_t *ent ) { - int i, j; + int i; float frameRadius; fog_t *fog; vec3_t localOrigin; @@ -1666,6 +1666,7 @@ int R_SpriteFogNum( trRefEntity_t *ent ) { VectorCopy(ent->e.origin, localOrigin); frameRadius = ent->e.radius; #ifndef REND2_SP + int j; for (i = 1; i < tr.world->numfogs; i++) { fog = &tr.world->fogs[i]; for (j = 0; j < 3; j++) { diff --git a/shared/rd-rend2/tr_mesh.cpp b/shared/rd-rend2/tr_mesh.cpp index 66d135d3e4..0ef3359691 100644 --- a/shared/rd-rend2/tr_mesh.cpp +++ b/shared/rd-rend2/tr_mesh.cpp @@ -168,7 +168,6 @@ RE_GetModelBounds void RE_GetModelBounds(refEntity_t *refEnt, vec3_t bounds1, vec3_t bounds2) { mdvFrame_t *frame; - //md3Header_t *header; model_t *model; assert(refEnt); @@ -269,7 +268,7 @@ R_ComputeFogNum ================= */ int R_ComputeFogNum( mdvModel_t *model, trRefEntity_t *ent ) { - int i, j; + int i; float frameRadius; fog_t *fog; mdvFrame_t *mdvFrame; @@ -284,6 +283,7 @@ int R_ComputeFogNum( mdvModel_t *model, trRefEntity_t *ent ) { VectorAdd( ent->e.origin, mdvFrame->localOrigin, localOrigin ); frameRadius = mdvFrame->radius; #ifndef REND2_SP + int j; for ( i = 1 ; i < tr.world->numfogs ; i++ ) { fog = &tr.world->fogs[i]; for ( j = 0 ; j < 3 ; j++ ) { From 63daa3b7f1a2de2a6039054495f17671196801c2 Mon Sep 17 00:00:00 2001 From: taysta Date: Sat, 6 Apr 2024 21:00:32 +0800 Subject: [PATCH 3/3] [jaPRO/Tribes] Only play going fast wind sound for tribes movestyle --- codemp/cgame/cg_players.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codemp/cgame/cg_players.c b/codemp/cgame/cg_players.c index 57e29c6b4e..e44227dfe3 100644 --- a/codemp/cgame/cg_players.c +++ b/codemp/cgame/cg_players.c @@ -10607,7 +10607,7 @@ void CG_Player( centity_t *cent ) { CG_VehicleEffects(cent); - if (cgs.jcinfo2& JAPRO_CINFO2_WTTRIBES) { //play wind sound if we are going fast. idk how to scale the volume so we are scaling the position of the speaker away from us (above us) to achieve that result + if (cg.predictedPlayerState.stats[STAT_MOVEMENTSTYLE] == MV_TRIBES) { //play wind sound if we are going fast. idk how to scale the volume so we are scaling the position of the speaker away from us (above us) to achieve that result const float speed2 = VectorLengthSquared(cg.predictedPlayerState.velocity); const float max_vol_speed = 3000*3000; const float min_vol_speed = 500*500;