Skip to content

Commit

Permalink
CSMultiplayerRules: Fix warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
eukara committed Mar 7, 2024
1 parent 8e3f5f2 commit f013035
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/server/gamerules_multiplayer.qc
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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);

Expand Down

0 comments on commit f013035

Please sign in to comment.