Skip to content

Commit

Permalink
[jaPRO] Fixup clang compiler warnings (#200)
Browse files Browse the repository at this point in the history
* things

(cherry picked from commit ddd5b36)

* warnings

(cherry picked from commit b99b0ba)

---------

Co-authored-by: videoP <[email protected]>
  • Loading branch information
taysta and videoP authored May 14, 2024
1 parent 1fdc838 commit 829a59a
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 13 deletions.
11 changes: 5 additions & 6 deletions codemp/game/ai_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -6793,10 +6793,10 @@ int NewBotAI_GetTribesWeapon(bot_state_t *bs)
if (distance > 3000) {
if (BotWeaponSelectable(bs, WP_DISRUPTOR))
bestWeapon = WP_DISRUPTOR;
else if (BotWeaponSelectable(bs, WP_BLASTER) && (bs->cur_ps.weapon != WP_BLASTER && bs->cur_ps.jetpackFuel == 100) || (bs->cur_ps.weapon == WP_BLASTER && bs->cur_ps.jetpackFuel > 10)) {
else if (BotWeaponSelectable(bs, WP_BLASTER) && ((bs->cur_ps.weapon != WP_BLASTER && bs->cur_ps.jetpackFuel == 100) || (bs->cur_ps.weapon == WP_BLASTER && bs->cur_ps.jetpackFuel > 10))) {
bestWeapon = WP_BLASTER;
}
else if (BotWeaponSelectableAltFire(bs, WP_BRYAR_OLD) && (bs->cur_ps.weapon == WP_BRYAR_OLD && bs->cur_ps.jetpackFuel == 100) || (bs->cur_ps.weapon == WP_BRYAR_OLD && bs->cur_ps.jetpackFuel > 10)) { //logic to let us run down to 0 but nto switch to 0
else if (BotWeaponSelectableAltFire(bs, WP_BRYAR_OLD) && ((bs->cur_ps.weapon == WP_BRYAR_OLD && bs->cur_ps.jetpackFuel == 100) || (bs->cur_ps.weapon == WP_BRYAR_OLD && bs->cur_ps.jetpackFuel > 10))) { //logic to let us run down to 0 but nto switch to 0
bestWeapon = WP_BRYAR_OLD;
bs->doAltAttack = 1;
bs->altChargeTime = 800;
Expand Down Expand Up @@ -6826,12 +6826,12 @@ int NewBotAI_GetTribesWeapon(bot_state_t *bs)
bestWeapon = WP_SABER;
}
else if (distance > 800 && distance < 2800) { //Have some padding between distance tiers so we dont weaponswitch spam
if (BotWeaponSelectableAltFire(bs, WP_BLASTER) && (bs->cur_ps.weapon != WP_BLASTER && bs->cur_ps.jetpackFuel == 100) || (bs->cur_ps.weapon == WP_BLASTER && bs->cur_ps.jetpackFuel > 10)) {
if (BotWeaponSelectableAltFire(bs, WP_BLASTER) && ((bs->cur_ps.weapon != WP_BLASTER && bs->cur_ps.jetpackFuel == 100) || (bs->cur_ps.weapon == WP_BLASTER && bs->cur_ps.jetpackFuel > 10))) {
bestWeapon = WP_BLASTER;
}
else if (BotWeaponSelectable(bs, WP_REPEATER) && forcedFireMode != 2)
bestWeapon = WP_REPEATER;
else if (BotWeaponSelectableAltFire(bs, WP_BRYAR_OLD) && (bs->cur_ps.weapon == WP_BRYAR_OLD && bs->cur_ps.jetpackFuel == 100) || (bs->cur_ps.weapon == WP_BRYAR_OLD && bs->cur_ps.jetpackFuel > 10)) {
else if (BotWeaponSelectableAltFire(bs, WP_BRYAR_OLD) && ((bs->cur_ps.weapon == WP_BRYAR_OLD && bs->cur_ps.jetpackFuel == 100) || (bs->cur_ps.weapon == WP_BRYAR_OLD && bs->cur_ps.jetpackFuel > 10))) {
bestWeapon = WP_BRYAR_OLD;
bs->doAltAttack = 1;
bs->altChargeTime = 800;
Expand Down Expand Up @@ -6871,7 +6871,7 @@ int NewBotAI_GetTribesWeapon(bot_state_t *bs)
if (BotWeaponSelectableAltFire(bs, WP_THERMAL) && (bs->currentEnemy->client->ps.powerups[PW_REDFLAG] || bs->currentEnemy->client->ps.powerups[PW_BLUEFLAG] || bs->currentEnemy->client->ps.powerups[PW_NEUTRALFLAG])) {
bestWeapon = WP_THERMAL;
}
if (BotWeaponSelectableAltFire(bs, WP_BLASTER) && (bs->cur_ps.weapon == WP_BLASTER && bs->cur_ps.jetpackFuel == 100) || (bs->cur_ps.weapon == WP_BLASTER && bs->cur_ps.jetpackFuel > 10)) {
if (BotWeaponSelectableAltFire(bs, WP_BLASTER) && ((bs->cur_ps.weapon == WP_BLASTER && bs->cur_ps.jetpackFuel == 100) || (bs->cur_ps.weapon == WP_BLASTER && bs->cur_ps.jetpackFuel > 10))) {
bestWeapon = WP_BLASTER;
bs->doAltAttack = 1;
}
Expand Down Expand Up @@ -8559,7 +8559,6 @@ qboolean NewBotAI_CapRoute(bot_state_t *bs, float thinktime)

void NewBotAI_Tribes(bot_state_t *bs, float thinktime)
{

//For capper bot. need to keep track of what spot we are at.
//How do we we store which route the bot is currently on?
//Bot->capRouteSequence starts at 0
Expand Down
11 changes: 8 additions & 3 deletions codemp/game/bg_slidemove.c
Original file line number Diff line number Diff line change
Expand Up @@ -838,12 +838,17 @@ qboolean PM_SlideMove( qboolean gravity ) {
// slide along the plane
PM_ClipVelocity (endVelocity, planes[i], endClipVelocity, OVERCLIP );
#if 1
//Com_Printf("^2Collision detection! Contents is %i %i %i %i\n", trace.surfaceFlags & MATERIAL_MASK, pml.groundTrace.surfaceFlags & MATERIAL_MASK, trace.contents & CONTENTS_INSIDE, pml.groundTrace.contents & CONTENTS_INSIDE);
if (pm->ps->stats[STAT_MOVEMENTSTYLE] == MV_TRIBES &&
(((pml.groundTrace.surfaceFlags & MATERIAL_MASK) >= MATERIAL_SHORTGRASS && (pml.groundTrace.surfaceFlags & MATERIAL_MASK) <= MATERIAL_GRAVEL) || ((pml.groundTrace.surfaceFlags & MATERIAL_MASK) == MATERIAL_MUD) || ((pml.groundTrace.surfaceFlags & MATERIAL_MASK) == MATERIAL_ROCK)) &&
(((pml.groundTrace.surfaceFlags & MATERIAL_MASK) >= MATERIAL_SHORTGRASS && (pml.groundTrace.surfaceFlags & MATERIAL_MASK) <= MATERIAL_GRAVEL) || ((pml.groundTrace.surfaceFlags & MATERIAL_MASK) == MATERIAL_MUD)) &&
(planes[i][2] == 0 || planes[i][2] == 1)) {//Vertical or horizontal brush collision in tribes mode
//For some reason I have to use pml.groundtrace results instead of trace results because trace results dont see the surfaceflags or contents (???). Need to add more material types for terrain detection. Or make use of surfaceparm terrain instead in the future.
pm->ps->pm_time = 250;
//Com_Printf("^3Deadstop detection! Mitigating! Contents is %i %i %i %i\n", trace.surfaceFlags & MATERIAL_MASK, pml.groundTrace.surfaceFlags & MATERIAL_MASK, trace.contents & CONTENTS_INSIDE, pml.groundTrace.contents & CONTENTS_INSIDE);
if (trace.contents & CONTENTS_INSIDE) { //all our terrain uses inside flag
pm->ps->pm_time = 250;
if (pm->debugLevel) {
Com_Printf("^3Deadstop detection! Mitigating! Contents is %i %i %i %i\n", trace.surfaceFlags & MATERIAL_MASK, pml.groundTrace.surfaceFlags & MATERIAL_MASK, trace.contents & CONTENTS_INSIDE, pml.groundTrace.contents & CONTENTS_INSIDE);
}
}
}
#endif

Expand Down
2 changes: 1 addition & 1 deletion codemp/game/g_missile.c
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ void G_MissileImpact( gentity_t *ent, trace_t *trace ) {
(ent->bounceCount > 0 || ent->bounceCount == -5) &&
(ent->flags & (FL_BOUNCE | FL_BOUNCE_HALF))) {

if ((g_tweakWeapons.integer & WT_TRIBES) && ent->s.weapon == WP_REPEATER || ent->s.weapon == WP_FLECHETTE) {
if ((g_tweakWeapons.integer & WT_TRIBES) && (ent->s.weapon == WP_REPEATER || ent->s.weapon == WP_FLECHETTE)) {
}
else {

Expand Down
4 changes: 2 additions & 2 deletions codemp/game/g_trigger.c
Original file line number Diff line number Diff line change
Expand Up @@ -1314,8 +1314,8 @@ qboolean ValidRaceSettings(int restrictions, gentity_t *player)
return qfalse;
if (sv_fps.integer != 20 && sv_fps.integer != 30 && sv_fps.integer != 40)//Dosnt really make a difference.. but eh.... loda fixme
return qfalse;
//if (com_timescale.value != 1.0f) //umm..
//return qfalse;
if (timescale.value != 1.0f) //umm..
return qfalse;
if (sv_pluginKey.integer) {
if (!player->client->pers.validPlugin && player->client->pers.userName[0]) { //Meh.. only do this if they are logged in to keep the print colors working right i guess..
trap->SendServerCommand( player-g_entities, "cp \"^3Warning: a newer client plugin version\nis required!\n\n\n\n\n\n\n\n\n\n\""); //Since times wont be saved if they arnt logged in anyway
Expand Down
3 changes: 2 additions & 1 deletion codemp/game/g_xcvar.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,11 @@ XCVAR_DEF( pmove_float, "0", NULL, CVAR_SYSTEMINFO|CVAR_ARCHIVE, qt
XCVAR_DEF( pmove_msec, "8", NULL, CVAR_SYSTEMINFO|CVAR_ARCHIVE, qtrue )
XCVAR_DEF( RMG, "0", NULL, CVAR_NONE, qtrue )
XCVAR_DEF( sv_cheats, "1", NULL, CVAR_NONE, qfalse )
XCVAR_DEF( sv_fps, "40", NULL, CVAR_ARCHIVE|CVAR_SERVERINFO, qtrue )
XCVAR_DEF( sv_fps, "40", NULL, CVAR_ARCHIVE|CVAR_SERVERINFO, qfalse )
XCVAR_DEF( sv_maxRate, "90000", NULL, CVAR_ARCHIVE|CVAR_SERVERINFO, qtrue )
XCVAR_DEF( sv_maxclients, "8", NULL, CVAR_SERVERINFO|CVAR_LATCH|CVAR_ARCHIVE, qfalse )
XCVAR_DEF( timelimit, "0", NULL, CVAR_SERVERINFO|CVAR_ARCHIVE|CVAR_NORESTART, qtrue )
XCVAR_DEF( timescale, "1", NULL, CVAR_NONE, qfalse)

//JAPRO CTF
XCVAR_DEF( g_flagDrag, "0", NULL, CVAR_ARCHIVE, qtrue )
Expand Down

0 comments on commit 829a59a

Please sign in to comment.