From 0ad3609c56faf7814810b39ce7df4165fe1a67d7 Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 1 Jul 2022 23:59:50 +1000 Subject: [PATCH] Disable deglobalisation logging, saves a tiny bit of performance Remove an unnecessary engine function call, may save a bit of performance when lots of projectiles are bouncing off eachother --- qcsrc/client/main.qc | 9 ++++----- qcsrc/client/main.qh | 2 +- qcsrc/lib/deglobalization.qh | 2 +- qcsrc/server/weapons/common.qc | 1 - 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/qcsrc/client/main.qc b/qcsrc/client/main.qc index 40d6cbbc2..435e9bbcb 100644 --- a/qcsrc/client/main.qc +++ b/qcsrc/client/main.qc @@ -265,7 +265,7 @@ void MoveToLast(entity e) AuditLists(); } -float RegisterTeam(entity Team) +void RegisterTeam(entity Team) { assert_once(Team.team, eprint(Team)); entity tm; @@ -281,7 +281,6 @@ float RegisterTeam(entity Team) if(Team.team && Team.team != NUM_SPECTATOR) ++team_count; AuditLists(); - return true; } void RemoveTeam(entity Team) @@ -320,7 +319,7 @@ entity GetTeam(int Team, bool add) return tm; } -.float has_team; +.bool has_team; bool SetTeam(entity o, int Team) { TC(int, Team); @@ -367,7 +366,7 @@ bool SetTeam(entity o, int Team) { tm = GetTeam(o.team, false); tm.team_size -= 1; - o.has_team = 0; + o.has_team = false; return true; } } @@ -378,7 +377,7 @@ bool SetTeam(entity o, int Team) o.team = Team; tm = GetTeam(Team, true); tm.team_size += 1; - o.has_team = 1; + o.has_team = true; return true; } else if(Team != o.team) diff --git a/qcsrc/client/main.qh b/qcsrc/client/main.qh index 7be53f6de..ee42bb55c 100644 --- a/qcsrc/client/main.qh +++ b/qcsrc/client/main.qh @@ -53,7 +53,7 @@ void RemovePlayer(entity player); void MoveToLast(entity e); -float RegisterTeam(entity Team); +void RegisterTeam(entity Team); void RemoveTeam(entity Team); diff --git a/qcsrc/lib/deglobalization.qh b/qcsrc/lib/deglobalization.qh index 3f71fd8ac..58f11edc7 100644 --- a/qcsrc/lib/deglobalization.qh +++ b/qcsrc/lib/deglobalization.qh @@ -34,7 +34,7 @@ #ifdef GAMEQC // menu doesn't use any globals // compile time switches in case perf is an issue -#define DEGLOB_LOGGING 1 +#define DEGLOB_LOGGING 0 #define DEGLOB_CLEAR 1 const int DEGLOB_ORIGINAL = 1; diff --git a/qcsrc/server/weapons/common.qc b/qcsrc/server/weapons/common.qc index a00eb120e..60fa5d73a 100644 --- a/qcsrc/server/weapons/common.qc +++ b/qcsrc/server/weapons/common.qc @@ -123,7 +123,6 @@ bool SUB_NoImpactCheck(entity this, entity toucher) if(trace_dphitcontents == 0) { LOG_TRACEF("A hit from a projectile happened with no hit contents! DEBUG THIS, this should never happen for projectiles! Projectile will self-destruct. (edict: %i, classname: %s, origin: %v)", this, this.classname, this.origin); - checkclient(this); // TODO: .health is checked in the engine with this, possibly replace with a QC function? } if (trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT) return true; -- 2.39.2