Preview of the coming weapon for weapprev/weapnext

The weapon you are changing to appears in the HUD, in "pickup" format.
Requires g_quick_weap == 1.
This commit is contained in:
Jaime Moreira 2023-12-16 17:53:25 -03:00
parent 15ac078a88
commit 95a40eef13

View file

@ -766,6 +766,12 @@ Cmd_WeapPrev_f(edict_t *ent)
/* prevent scrolling through ALL weapons */
if (cl->newweapon == it)
{
if (g_quick_weap->value)
{
cl->ps.stats[STAT_PICKUP_ICON] = gi.imageindex(cl->newweapon->icon);
cl->ps.stats[STAT_PICKUP_STRING] = CS_ITEMS + ITEM_INDEX(cl->newweapon);
cl->pickup_msg_time = level.time + 0.9f;
}
return;
}
}
@ -824,6 +830,12 @@ Cmd_WeapNext_f(edict_t *ent)
/* prevent scrolling through ALL weapons */
if (cl->newweapon == it)
{
if (g_quick_weap->value)
{
cl->ps.stats[STAT_PICKUP_ICON] = gi.imageindex(cl->newweapon->icon);
cl->ps.stats[STAT_PICKUP_STRING] = CS_ITEMS + ITEM_INDEX(cl->newweapon);
cl->pickup_msg_time = level.time + 0.9f;
}
return;
}
}