From 1bf5dc9924496130186091a69f9f4387db021a38 Mon Sep 17 00:00:00 2001 From: Marco Hladik Date: Fri, 17 Dec 2021 18:23:15 -0800 Subject: [PATCH] Client: Enable the damage/item notifications from Half-Life. --- src/client/progs.src | 2 ++ src/shared/player.qc | 22 +++++++++++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/client/progs.src b/src/client/progs.src index 3be68f9..c331098 100644 --- a/src/client/progs.src +++ b/src/client/progs.src @@ -33,6 +33,8 @@ init.qc ../../../valve/src/client/view.qc ../../../valve/src/client/obituary.qc ../../../valve/src/client/hud_ammonotify.qc +../../../valve/src/client/hud_dmgnotify.qc +../../../valve/src/client/hud_itemnotify.qc ../../../valve/src/client/hud.qc ../../../valve/src/client/hud_weaponselect.qc ../../../valve/src/client/scoreboard.qc diff --git a/src/shared/player.qc b/src/shared/player.qc index cd1d4cf..fa0c2c4 100644 --- a/src/shared/player.qc +++ b/src/shared/player.qc @@ -113,6 +113,8 @@ class player:base_player #ifdef CLIENT void Weapons_AmmoUpdate(entity); +void HUD_AmmoNotify_Check(player pl); +void HUD_ItemNotify_Check(player pl); /* ================= player::ReceiveEntity @@ -179,10 +181,24 @@ player::ReceiveEntity(float new, float fl) mode_silencer = readbyte(); } - if (fl & PLAYER_AMMO1 || fl & PLAYER_AMMO2 || fl & PLAYER_AMMO3) - Weapons_AmmoUpdate(this); - setorigin(this, origin); + + /* these only concern the current player */ + CSQC_UpdateSeat(); + if (this != pSeat->m_ePlayer) + return; + + /* do not notify us of updates when spawning initially */ + if (fl == UPDATE_ALL) + PredictPreFrame(); + + if (fl & PLAYER_AMMO1 || fl & PLAYER_AMMO2 || fl & PLAYER_AMMO3) { + Weapons_AmmoUpdate(this); + HUD_AmmoNotify_Check(this); + } + + if (fl & PLAYER_ITEMS || fl & PLAYER_HEALTH || fl & PLAYER_ARMOR) + HUD_ItemNotify_Check(this); } /*