Skip to content

Commit

Permalink
add a cvar which allows players to disable the coop coded accuracy so…
Browse files Browse the repository at this point in the history
… the accuracy in the ai scripts is used instead: g_ignorescriptedaccuracy
  • Loading branch information
Frederik Delaere committed Dec 29, 2022
1 parent 50a728b commit 2cd3af6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion code/game/ai_cast_fight.c
Expand Up @@ -1966,7 +1966,7 @@ float AICast_GetAccuracy( int entnum ) {
// the more they stay in our sights, the more accurate we get
acc = cs->attributes[AIM_ACCURACY];

if ( g_gametype.integer <= GT_COOP ) {
if ( g_gametype.integer <= GT_COOP && g_ignorescriptedaccuracy.integer == qtrue ) {
if ( g_gameskill.integer == GSKILL_EASY ) {
acc = 0.5;
} else if ( g_gameskill.integer == GSKILL_MEDIUM ) {
Expand Down
2 changes: 1 addition & 1 deletion code/game/g_combat.c
Expand Up @@ -926,7 +926,7 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker,
int asave;
int knockback;
qboolean attackerpain = qfalse;
G_Printf("------------> %s\n", targ->model);
//G_Printf("------------> %s\n", targ->model);

if ( !targ->takedamage ) {
return;
Expand Down
2 changes: 2 additions & 0 deletions code/game/g_local.h
Expand Up @@ -1330,6 +1330,8 @@ extern vmCvar_t g_shove;
extern vmCvar_t g_shoveAmount;
extern vmCvar_t g_throwKnives;

extern vmCvar_t g_ignorescriptedaccuracy;

extern vmCvar_t g_showMOTD;
extern vmCvar_t motdNum;
extern vmCvar_t g_motdTime;
Expand Down
3 changes: 3 additions & 0 deletions code/game/g_main.c
Expand Up @@ -129,6 +129,8 @@ vmCvar_t g_smoothClients;
vmCvar_t pmove_fixed;
vmCvar_t pmove_msec;

vmCvar_t g_ignorescriptedaccuracy;

// Rafael
vmCvar_t g_autoactivate;
vmCvar_t g_testPain;
Expand Down Expand Up @@ -231,6 +233,7 @@ cvarTable_t gameCvarTable[] = {
{ &g_soldierChargeTime, "g_soldierChargeTime", "20000", CVAR_SERVERINFO | CVAR_LATCH, 0, qfalse },
{ &g_reinforce, "g_reinforce", "0", CVAR_ARCHIVE | CVAR_SERVERINFO | CVAR_LATCH, 0, qfalse },
{ &g_freeze, "g_freeze", "0", CVAR_ARCHIVE | CVAR_SERVERINFO, 0, qfalse },
{ &g_ignorescriptedaccuracy, "g_ignorescriptedaccuracy", "1", CVAR_ARCHIVE | CVAR_SERVERINFO, 0, qfalse },

{ &g_maxclients, "sv_maxclients", "8", CVAR_SERVERINFO | CVAR_LATCH | CVAR_ARCHIVE, 0, qfalse },
{ &g_maxGameClients, "g_maxGameClients", "0", CVAR_SERVERINFO | CVAR_LATCH | CVAR_ARCHIVE, 0, qfalse },
Expand Down

0 comments on commit 2cd3af6

Please sign in to comment.