Valve & Mods: Fixed Hud_SlotSelect bug in which you could weapons you did

not have in your inventory.
This commit is contained in:
Marco Cawthorne 2020-03-31 06:42:03 +02:00
parent b8621deea5
commit 163ac1993d
5 changed files with 5 additions and 4 deletions

View File

@ -125,7 +125,7 @@ void HUD_SlotSelect(int slot)
/* weren't in that slot? select the first one then */
if (curslot != slot) {
for (i = 1; i < g_weapons.length; i++) {
if (g_weapons[i].slot == slot) {
if (g_weapons[i].slot == slot && pl.g_items & g_weapons[i].id) {
pSeat->fHUDWeaponSelected = i;
pSeat->fHUDWeaponSelectTime = time + 3;
break;

View File

@ -131,7 +131,7 @@ void HUD_SlotSelect(int slot)
/* weren't in that slot? select the first one then */
if (curslot != slot) {
for (i = 1; i < g_weapons.length; i++) {
if (g_weapons[i].slot == slot) {
if (g_weapons[i].slot == slot && pl.g_items & g_weapons[i].id) {
pSeat->fHUDWeaponSelected = i;
pSeat->fHUDWeaponSelectTime = time + 3;
break;

View File

@ -133,7 +133,7 @@ void HUD_SlotSelect(int slot)
/* weren't in that slot? select the first one then */
if (curslot != slot) {
for (i = 1; i < g_weapons.length; i++) {
if (g_weapons[i].slot == slot) {
if (g_weapons[i].slot == slot && pl.g_items & g_weapons[i].id) {
pSeat->fHUDWeaponSelected = i;
pSeat->fHUDWeaponSelectTime = time + 3;
break;

View File

@ -125,7 +125,7 @@ void HUD_SlotSelect(int slot)
/* weren't in that slot? select the first one then */
if (curslot != slot) {
for (i = 1; i < g_weapons.length; i++) {
if (g_weapons[i].slot == slot) {
if (g_weapons[i].slot == slot && pl.g_items & g_weapons[i].id) {
pSeat->fHUDWeaponSelected = i;
pSeat->fHUDWeaponSelectTime = time + 3;
break;

View File

@ -110,6 +110,7 @@ Gamerules_Spawn(player pl)
if (cvar("sv_playerslots") == 1 || cvar("coop") == 1) {
if (startspot != "") {
print(sprintf("^1Gamerules_Spawn: Startspot is %s\n", startspot));
Gamerules_DecodeChangeParms(pl);
setorigin(pl, Landmark_GetSpot());
} else {