Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion include/progs.h
Original file line number Diff line number Diff line change
Expand Up @@ -968,7 +968,6 @@ typedef struct gedict_s
int nullStrafeCount;
// SOCD

qbool leavemealone;
float shownick_time; // used to force centerprint is off at desired time
clientType_t ct; // client type for client edicts
// { timing
Expand Down
21 changes: 3 additions & 18 deletions src/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,9 @@ void CheckTiming(void)
p->s.v.solid = 0;
p->s.v.movetype = 0;
SetVector(p->s.v.velocity, 0, 0, 0); // speed is zeroed and not restored

// Relink after solid change to avoid stale area list membership
setorigin(p, PASSVEC3(p->s.v.origin));
}
}

}
else
{
Expand Down Expand Up @@ -1806,7 +1804,7 @@ void PutClientInServer(void)
self->classname = "player";
self->s.v.health = 100;
self->s.v.takedamage = DAMAGE_AIM;
self->s.v.solid = isCA() ? SOLID_NOT : self->leavemealone ? SOLID_TRIGGER : SOLID_SLIDEBOX;
self->s.v.solid = isCA() ? SOLID_NOT : SOLID_SLIDEBOX;
self->s.v.movetype = MOVETYPE_WALK;
self->show_hostile = 0;
self->s.v.max_health = 100;
Expand Down Expand Up @@ -2029,7 +2027,7 @@ void PutClientInServer(void)
}
else
{
self->s.v.solid = self->leavemealone ? SOLID_TRIGGER : SOLID_SLIDEBOX;
self->s.v.solid = SOLID_SLIDEBOX;
}
setorigin(self, PASSVEC3(self->s.v.origin));

Expand Down Expand Up @@ -3056,9 +3054,6 @@ void BackFromLag(void)
self->s.v.takedamage = self->k_timingTakedmg;
self->s.v.solid = self->k_timingSolid;
self->s.v.movetype = self->k_timingMovetype;

// Relink after solid change to ensure proper area list placement
setorigin(self, PASSVEC3(self->s.v.origin));
}
}

Expand Down Expand Up @@ -3873,16 +3868,6 @@ void PlayerPreThink(void)

race_player_pre_think();

if (self->leavemealone)
{
if ((self->s.v.mins[0] == 0) || (self->s.v.mins[1] == 0))
{
// This can happen if the world 'squashes' a SOLID_NOT entity, mvdsv will turn into corpse
setsize(self, PASSVEC3(VEC_HULL_MIN), PASSVEC3(VEC_HULL_MAX));
}
setorigin(self, PASSVEC3(self->s.v.origin));
}

// brokenankle included here
if (self->s.v.button2 || self->brokenankle)
{
Expand Down
15 changes: 0 additions & 15 deletions src/combat.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,21 +463,6 @@ void T_Damage(gedict_t *targ, gedict_t *inflictor, gedict_t *attacker, float dam
return;
}

// don't bounce around players in prewar who wish to be left alone
if (match_in_progress != 2 && targ->leavemealone)
{
if (attacker != targ && ((targ->ct == ctPlayer) && (attacker->ct == ctPlayer)))
{
return;
}
else if (dtTELE1 == targ->deathtype // always do tele damage
|| dtTELE2 == targ->deathtype // always do tele damage
|| dtTELE3 == targ->deathtype) // always do tele damage
{
// telefrags still work, to avoid getting stuck
}
}

// can't damage other players in race
if (isRACE() && (attacker != targ))
{
Expand Down
30 changes: 0 additions & 30 deletions src/commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@
// } CTF
void FragsDown(void);
void FragsUp(void);
void LeaveMeAlone(void);
void ListWhoNot(void);
void ModStatus1(void);
void ModStatus2(void);
Expand Down Expand Up @@ -395,7 +394,6 @@
#define CD_CTOCT "Show octal charset table"
#define CD_CTHEX "Show hexadecimal charset table"
#define CD_SHOWNICK "pointed player's info"
#define CD_LEAVEMEALONE "can't shoot/bounce players in prewar"
#define CD_TIME5 "set timelimit to 5 mins"
#define CD_TIME10 "set timelimit to 10 mins"
#define CD_TIME15 "set timelimit to 15 mins"
Expand Down Expand Up @@ -762,7 +760,6 @@
{ "sct_hex", ShowCharsetTableHexa, 0, CF_BOTH, CD_CTHEX },
{ "about", ShowVersion, 0, CF_BOTH | CF_MATCHLESS, CD_ABOUT },
{ "shownick", ShowNick, 0, CF_PLAYER | CF_PARAMS, CD_SHOWNICK },
{ "leavemealone", LeaveMeAlone, 0, CF_PLAYER | CF_PARAMS, CD_LEAVEMEALONE },
{ "time5", DEF(TimeSet), 5.0f, CF_PLAYER | CF_SPC_ADMIN, CD_TIME5 },
{ "time10", DEF(TimeSet), 10.0f, CF_PLAYER | CF_SPC_ADMIN, CD_TIME10 },
{ "time15", DEF(TimeSet), 15.0f, CF_PLAYER | CF_SPC_ADMIN, CD_TIME15 },
Expand Down Expand Up @@ -1900,12 +1897,12 @@

if (floor(k_captains) == 1)
{
G_sprint(self, 2, "\2201\221 %s present\n", redtext("captain"));

Check warning on line 1900 in src/commands.c

View workflow job for this annotation

GitHub Actions / verify-msvc

decimal digit terminates octal escape sequence [D:\a\ktx\ktx\builddir\qwprogs.vcxproj]
}

if (floor(k_coaches) == 1)
{
G_sprint(self, 2, "\2201\221 %s present\n", redtext("coach"));

Check warning on line 1905 in src/commands.c

View workflow job for this annotation

GitHub Actions / verify-msvc

decimal digit terminates octal escape sequence [D:\a\ktx\ktx\builddir\qwprogs.vcxproj]
}

if (match_in_progress == 2)
Expand Down Expand Up @@ -4141,33 +4138,6 @@
self->shownick_time = g_globalvars.time + 0.8; // clear centerprint at this time
}

void LeaveMeAlone(void)
{
if (match_in_progress)
{
return;
}

if (isRA() || isRACE())
{
return;
}

if (self->leavemealone)
{
G_bprint(2, "%s %s\n", self->netname, redtext("no longer wants to be left alone"));
self->s.v.solid = SOLID_SLIDEBOX;
}
else
{
G_bprint(2, "%s %s\n", self->netname, redtext("wants to be left alone"));
self->s.v.solid = SOLID_TRIGGER;
}

setorigin(self, PASSVEC3(self->s.v.origin));
self->leavemealone = !self->leavemealone;
}

// qqshka

// below predefined settings for usermodes
Expand Down
7 changes: 0 additions & 7 deletions src/match.c
Original file line number Diff line number Diff line change
Expand Up @@ -985,7 +985,6 @@
for (p = world; (p = find_plr(p));)
{
players[player_count++] = p;
p->leavemealone = false; // can't have this enabled during match
}

for (i = player_count - 1; i > 0; i--)
Expand Down Expand Up @@ -1650,7 +1649,7 @@
if (hm_timelimit)
{
int minutes = hm_timelimit / 60;
int seconds = hm_timelimit % 60;

Check warning on line 1652 in src/match.c

View workflow job for this annotation

GitHub Actions / verify-msvc

declaration of 'seconds' hides function parameter [D:\a\ktx\ktx\builddir\qwprogs.vcxproj]

if (minutes == 0)
{
Expand Down Expand Up @@ -1999,9 +1998,6 @@
p->s.v.movetype = 0;
p->s.v.modelindex = 0;
p->model = "";

// Relink after solid change to keep area lists consistent
setorigin(p, PASSVEC3(p->s.v.origin));
}
}
}
Expand Down Expand Up @@ -2533,9 +2529,6 @@
p->s.v.solid = SOLID_SLIDEBOX;
p->s.v.movetype = MOVETYPE_WALK;
setmodel(p, "progs/player.mdl");

// Relink after solid change so players are returned to the correct list
setorigin(p, PASSVEC3(p->s.v.origin));
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/triggers.c
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@
}

// only teleport living creatures
if (ISDEAD(other) || (!isRACE() && (other->s.v.solid != SOLID_SLIDEBOX) && !other->leavemealone))
if (ISDEAD(other) || (!isRACE() && (other->s.v.solid != SOLID_SLIDEBOX)))
{
return;
}
Expand Down Expand Up @@ -899,7 +899,7 @@
}

self->attack_finished = g_globalvars.time + 2;
if (/*trap_cvar( "registered" )*/true)

Check warning on line 902 in src/triggers.c

View workflow job for this annotation

GitHub Actions / verify-msvc

conditional expression is constant [D:\a\ktx\ktx\builddir\qwprogs.vcxproj]
{
self->message = "";
activator = other;
Expand Down
23 changes: 0 additions & 23 deletions src/weapons.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@
//vec3_t org;

missile = spawn();
missile->s.v.owner = EDICT_TO_PROG(self);

Check warning on line 198 in src/weapons.c

View workflow job for this annotation

GitHub Actions / verify-macos

implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
missile->s.v.movetype = MOVETYPE_BOUNCE;
missile->isMissile = true;
missile->s.v.solid = SOLID_NOT;
Expand Down Expand Up @@ -377,12 +377,6 @@
return;
}

//can't touch/damage players who want to be left alone
if (PROG_TO_EDICT(g_globalvars.trace_ent)->ct == ctPlayer && PROG_TO_EDICT(g_globalvars.trace_ent)->leavemealone)
{
return;
}

if (PROG_TO_EDICT(g_globalvars.trace_ent)->s.v.takedamage)
{
if (PROG_TO_EDICT(g_globalvars.trace_ent)->ct == ctPlayer)
Expand Down Expand Up @@ -444,8 +438,8 @@
if (cvar("k_cg_kb"))
{
newmis = spawn();
g_globalvars.newmis = EDICT_TO_PROG(newmis);

Check warning on line 441 in src/weapons.c

View workflow job for this annotation

GitHub Actions / verify-macos

implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
newmis->s.v.owner = EDICT_TO_PROG(self);

Check warning on line 442 in src/weapons.c

View workflow job for this annotation

GitHub Actions / verify-macos

implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
newmis->s.v.movetype = MOVETYPE_FLYMISSILE;
newmis->isMissile = true;
newmis->s.v.solid = SOLID_BBOX;
Expand Down Expand Up @@ -536,7 +530,7 @@

VectorCopy(self->s.v.origin, tmp); //tmp = self->s.v.origin + '0 0 16';
tmp[2] += 16;
CoilgunTrail(tmp, src, self - world, iKey(self, "railcolor"));

Check warning on line 533 in src/weapons.c

View workflow job for this annotation

GitHub Actions / verify-macos

implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
}

/*
Expand Down Expand Up @@ -827,7 +821,7 @@
sound(self, CHAN_WEAPON, "weapons/guncock.wav", 1, ATTN_NORM);
}

g_globalvars.msg_entity = EDICT_TO_PROG(self);

Check warning on line 824 in src/weapons.c

View workflow job for this annotation

GitHub Actions / verify-macos

implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]

WriteByte( MSG_ONE, SVC_SMALLKICK);

Expand Down Expand Up @@ -876,7 +870,7 @@

sound(self, CHAN_WEAPON, "weapons/shotgn2.wav", 1, ATTN_NORM);

g_globalvars.msg_entity = EDICT_TO_PROG(self);

Check warning on line 873 in src/weapons.c

View workflow job for this annotation

GitHub Actions / verify-macos

implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]

WriteByte( MSG_ONE, SVC_BIGKICK);

Expand Down Expand Up @@ -966,11 +960,6 @@
return;
}

if (other->leavemealone)
{
return;
}

if (self->voided)
{
return;
Expand Down Expand Up @@ -1054,12 +1043,12 @@

sound(self, CHAN_WEAPON, "weapons/sgun1.wav", 1, ATTN_NORM);

g_globalvars.msg_entity = EDICT_TO_PROG(self);

Check warning on line 1046 in src/weapons.c

View workflow job for this annotation

GitHub Actions / verify-macos

implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
WriteByte( MSG_ONE, SVC_SMALLKICK);

newmis = spawn();
g_globalvars.newmis = EDICT_TO_PROG(newmis);

Check warning on line 1050 in src/weapons.c

View workflow job for this annotation

GitHub Actions / verify-macos

implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
newmis->s.v.owner = EDICT_TO_PROG(self);

Check warning on line 1051 in src/weapons.c

View workflow job for this annotation

GitHub Actions / verify-macos

implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
newmis->s.v.movetype = MOVETYPE_FLYMISSILE;
newmis->isMissile = true;
newmis->s.v.solid = (isRACE() ? SOLID_TRIGGER : SOLID_BBOX);
Expand Down Expand Up @@ -1250,7 +1239,7 @@
self->t_width = g_globalvars.time + 0.6;
}

g_globalvars.msg_entity = EDICT_TO_PROG(self);

Check warning on line 1242 in src/weapons.c

View workflow job for this annotation

GitHub Actions / verify-macos

implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
WriteByte( MSG_ONE, SVC_SMALLKICK);

if (match_in_progress == 2)
Expand Down Expand Up @@ -1334,12 +1323,6 @@
return;
}

// can't touch players who want to be left alone
if (other->leavemealone)
{
return;
}

if (other->s.v.takedamage)
{
if (other->ct == ctPlayer)
Expand Down Expand Up @@ -1534,12 +1517,6 @@
return;
}

// can't touch players who want to be left alone
if (other->leavemealone)
{
return;
}

if (self->voided)
{
return;
Expand Down
Loading