diff --git a/src/client/progs.src b/src/client/progs.src index b541fef..cd525ca 100644 --- a/src/client/progs.src +++ b/src/client/progs.src @@ -32,6 +32,8 @@ ../../../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/server/gamerules.qc b/src/server/gamerules.qc index 7d98fdf..8e3733c 100644 --- a/src/server/gamerules.qc +++ b/src/server/gamerules.qc @@ -56,26 +56,12 @@ SHMultiplayerRules::PlayerDeath(base_player pl) pl.nextthink = time + 4.0f; Sound_Play(pl, CHAN_AUTO, "player.die"); + /* either gib, or make a corpse */ if (pl.health < -50) { - pl.health = 0; FX_GibHuman(pl.origin); - return; + } else { + FX_Corpse_Spawn(pl, ANIM_DIESIMPLE); } - - pl.health = 0; - - /* Let's handle corpses on the clientside */ - entity corpse = spawn(); - setorigin(corpse, pl.origin + [0,0,32]); - setmodel(corpse, pl.model); - setsize(corpse, VEC_HULL_MIN, VEC_HULL_MAX); - corpse.movetype = MOVETYPE_TOSS; - corpse.solid = SOLID_TRIGGER; - corpse.modelindex = pl.modelindex; - corpse.frame = ANIM_DIESIMPLE; - corpse.angles = pl.angles; - corpse.velocity = pl.velocity; - corpse.colormap = pl.colormap; } void diff --git a/src/server/server.qc b/src/server/server.qc index c938c35..c19ff6d 100644 --- a/src/server/server.qc +++ b/src/server/server.qc @@ -32,4 +32,5 @@ Game_Worldspawn(void) Player_Precache(); Weapons_Init(); SHData_Parse(mapname); + FX_Corpse_Init(); } diff --git a/src/shared/include.src b/src/shared/include.src index dd00fa6..da8d31f 100644 --- a/src/shared/include.src +++ b/src/shared/include.src @@ -16,6 +16,7 @@ pmove.qc ../../../valve/src/shared/fx_gibhuman.qc ../../../base/src/shared/fx_spark.qc ../../../valve/src/shared/fx_impact.qc +../../../base/src/shared/fx_corpse.qc items.h weapons.h diff --git a/src/shared/player.qc b/src/shared/player.qc index 8660db0..761cabb 100644 --- a/src/shared/player.qc +++ b/src/shared/player.qc @@ -107,7 +107,8 @@ class player:base_player #ifdef CLIENT void Weapons_AmmoUpdate(entity); -void HUD_AmmoNotify_Check(player); +void HUD_AmmoNotify_Check(player pl); +void HUD_ItemNotify_Check(player pl); /* ================= player::ReceiveEntity @@ -166,12 +167,24 @@ player::ReceiveEntity(float new, float fl) ammo_hammer_state = readbyte(); } + 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); } - setorigin(this, origin); + if (fl & PLAYER_ITEMS || fl & PLAYER_HEALTH || fl & PLAYER_ARMOR) + HUD_ItemNotify_Check(this); } /*