Client: Enable the damage/item notifications from Half-Life. Use the new corpse stuff.

This commit is contained in:
Marco Cawthorne 2021-12-17 18:24:04 -08:00
parent b1d47ca4f3
commit a005f5b45a
Signed by: eukara
GPG Key ID: C196CD8BA993248A
5 changed files with 22 additions and 19 deletions

View File

@ -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

View File

@ -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

View File

@ -32,4 +32,5 @@ Game_Worldspawn(void)
Player_Precache();
Weapons_Init();
SHData_Parse(mapname);
FX_Corpse_Init();
}

View File

@ -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

View File

@ -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);
}
/*