Skip to content

Commit

Permalink
Fixed the GHUD issue
Browse files Browse the repository at this point in the history
  • Loading branch information
darkshade9 committed Mar 1, 2024
1 parent 062c86b commit 46d3d0f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions source/p_hud.c
Original file line number Diff line number Diff line change
Expand Up @@ -1005,10 +1005,12 @@ void HUD_SpectatorUpdate(edict_t *clent)
Ghud_SetText(clent, hud[h + 2], nm_s);
Ghud_SetText(clent, hud[h + 3], kdr_s);

int weapNum = cl->pers.chosenWeapon ? cl->pers.chosenWeapon->typeNum : 0;

if (IS_ALIVE(cl_ent) && cl->curr_weap)
Ghud_SetInt(clent, hud[h + 4], level.pic_items[cl->curr_weap]);
// else if (cl->resp.team && cl->pers.chosenWeapon->typeNum)
// Ghud_SetInt(clent, hud[h + 4], level.pic_items[cl->pers.chosenWeapon->typeNum]);
else if (cl->resp.team == TEAM1 && weapNum)
Ghud_SetInt(clent, hud[h + 4], level.pic_items[weapNum]);
else // no weapon, set to mk23
Ghud_SetInt(clent, hud[h + 4], level.pic_items[MK23_NUM]);
}
Expand Down Expand Up @@ -1086,10 +1088,12 @@ void HUD_SpectatorUpdate(edict_t *clent)
Ghud_SetText(clent, hud[h + 2], nm_s);
Ghud_SetText(clent, hud[h + 3], kdr_s);

int weapNum = cl->pers.chosenWeapon ? cl->pers.chosenWeapon->typeNum : 0;

if (IS_ALIVE(cl_ent) && cl->curr_weap)
Ghud_SetInt(clent, hud[h + 4], level.pic_items[cl->curr_weap]);
// else if (cl->resp.team && cl->pers.chosenWeapon->typeNum)
// Ghud_SetInt(clent, hud[h + 4], level.pic_items[cl->pers.chosenWeapon->typeNum]);
else if (cl->resp.team == TEAM2 && weapNum)
Ghud_SetInt(clent, hud[h + 4], level.pic_items[weapNum]);
else // no weapon, set to mk23
Ghud_SetInt(clent, hud[h + 4], level.pic_items[MK23_NUM]);
}
Expand Down

0 comments on commit 46d3d0f

Please sign in to comment.