Skip to content

Fix slots 2#1096

Open
drzel wants to merge 10 commits intoFortressOne:masterfrom
drzel:fix-slots-2
Open

Fix slots 2#1096
drzel wants to merge 10 commits intoFortressOne:masterfrom
drzel:fix-slots-2

Conversation

@drzel
Copy link
Copy Markdown
Member

@drzel drzel commented Feb 26, 2023

+slot command to replace +slot1-4 and +quick1-4.

This fixes a couple of issues I have with +slotx aliases / config:

  • As engy, if I'm holding +slot4 (spanner) while reloading, when the reload finishes I'll simply shoot whichever weapon was selected before I started reloading, killing the gun and myself.
  • Pressing +slot1;+slot2;-slot2 should return to firing weapon 1, atm it stops shooting.

I'm keeping a history of slot changes so I know what to return to.

A future improvement will for it to understand class / ammo and not attempt to fire if there's no weapon / ammo on a given slot.

csqc/main.qc Outdated
local float slotdowns = changed_slots & input_buttons;
local float slotups = changed_slots & ~input_buttons;

if (input_slots) { // if using slots, you definitely should be shooting
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this isn't actually true, e.g. if you're holding +slot3 as a scout or engy, it shouldn't do anything. likewise if the weapon has no ammo.

@drzel drzel marked this pull request as ready for review February 26, 2023 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants