From: Mario Date: Sat, 16 Jun 2018 18:45:59 +0000 (+1000) Subject: Litter the code with a few notes about where health is accessed in the engine and... X-Git-Tag: xonotic-v0.8.5~2029 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=c6f3178089a11e4c8111b5dfd524fbc89cd03776;p=xonotic%2Fxonotic-data.pk3dir.git Litter the code with a few notes about where health is accessed in the engine and possible QC-based solutions --- diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc index d036bd75d..4d355fb2a 100644 --- a/qcsrc/client/view.qc +++ b/qcsrc/client/view.qc @@ -2057,7 +2057,7 @@ void CSQC_UpdateView(entity this, float w, float h) IL_EACH(g_drawables, it.draw, it.draw(it)); - addentities(MASK_NORMAL | MASK_ENGINE | MASK_ENGINEVIEWMODELS); + addentities(MASK_NORMAL | MASK_ENGINE | MASK_ENGINEVIEWMODELS); // TODO: .health is used in cl_deathfade (a feature we have turned off currently) renderscene(); // now switch to 2D drawing mode by calling a 2D drawing function diff --git a/qcsrc/lib/csqcmodel/cl_player.qc b/qcsrc/lib/csqcmodel/cl_player.qc index 225c7307d..f87f00033 100644 --- a/qcsrc/lib/csqcmodel/cl_player.qc +++ b/qcsrc/lib/csqcmodel/cl_player.qc @@ -291,7 +291,7 @@ void CSQCPlayer_SetCamera() // note: these two only work in WIP2, but are harmless in WIP1 if (PHYS_HEALTH(NULL) <= 0 && PHYS_HEALTH(NULL) != -666 && PHYS_HEALTH(NULL) != -2342) refdefflags |= REFDEFFLAG_DEAD; if (intermission) refdefflags |= REFDEFFLAG_INTERMISSION; - V_CalcRefdef(view, refdefflags); + V_CalcRefdef(view, refdefflags); // TODO? uses .health stat in the engine when this isn't called here, may be broken! } else { diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index 121d092f9..0c740545c 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -1082,6 +1082,8 @@ void ClientKill_TeamChange (entity this, float targetteam) // 0 = don't change, void ClientKill (entity this) { + // TODO: once .health is removed, will need to check it here for the "already dead" message! + if(game_stopped) return; if(this.player_blocked) return; if(STAT(FROZEN, this)) return; diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index d4231a70c..319b6f16f 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -1060,7 +1060,7 @@ 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); + checkclient(this); // TODO: .health is checked in the engine with this, possibly replace with a QC function? } if (trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT) return true;