CSMultiplayerRules: Fix warnings.

This commit is contained in:
Marco Cawthorne 2024-03-06 19:40:02 -08:00
parent 8e3f5f2752
commit f013035ffc
Signed by: eukara
GPG Key ID: CE2032F0A2882A22
1 changed files with 10 additions and 8 deletions

View File

@ -45,9 +45,8 @@ CSMultiplayerRules::PlayerDeath(NSClientPlayer pl)
player targ = (player)g_dmg_eTarget;
player attk = (player)g_dmg_eAttacker;
NSRenderableEntity newCorpse;
float deathAnimation;
float deathAnimation = ANIM_DEATH1;
/* TODO: death anims based on hit-regions */
if (targ.flags & FL_CROUCHING) {
deathAnimation = ANIM_CROUCH_DIE;
} else {
@ -66,18 +65,21 @@ CSMultiplayerRules::PlayerDeath(NSClientPlayer pl)
break;
default:
bool isFacing = targ.IsFacingPosition(g_dmg_vecLocation);
deathAnimation = ANIM_DEATH1;
if (isFacing == false)
deathAnimation = ANIM_DIE_FORWARD;
else
deathAnimation = ANIM_DIE_BACK;
/* still want to play ANIM_DEATH1 */
if (random() < 0.5f) {
if (isFacing == false) {
deathAnimation = ANIM_DIE_FORWARD;
} else {
deathAnimation = ANIM_DIE_BACK;
}
}
break;
}
}
newCorpse = FX_Corpse_Spawn(targ, deathAnimation);
newCorpse = (NSRenderableEntity)FX_Corpse_Spawn(targ, deathAnimation);
targ.SpectatorDeathcam(newCorpse, attk, 3.0f);