From 01ce6787dc805816d7cafa533aa871e38f0791ed Mon Sep 17 00:00:00 2001 From: Jaime Moreira Date: Sat, 16 Dec 2023 17:42:53 -0300 Subject: [PATCH] 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. --- src/game/g_cmds.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index 2f03e824..304d0c6e 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -768,6 +768,12 @@ Cmd_WeapPrev_f(edict_t *ent) 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; /* successful */ } } @@ -824,6 +830,12 @@ Cmd_WeapNext_f(edict_t *ent) 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; /* successful */ } }