Client: Enable the damage/item notifications from Half-Life. Use the new corpse stuff.
This commit is contained in:
parent
b1d47ca4f3
commit
a005f5b45a
5 changed files with 22 additions and 19 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -32,4 +32,5 @@ Game_Worldspawn(void)
|
|||
Player_Precache();
|
||||
Weapons_Init();
|
||||
SHData_Parse(mapname);
|
||||
FX_Corpse_Init();
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue