Among many other criteria I use a bIsFiring?
bool in a macro. The macro is called several times across the processing of the input action.
The character class, where input is handled, I use a different variant of the macro check. It’s quite a bit more simplified. It basically just checking that the base conditions are met. Has a gun, it’s equipped, you aren’t jumping or in water (swimming).
If the check clears I call Client Weapon Fire
in the weapon class. It’s job is to determine the firing mode to use vs the client outright calling a mode. All weapon logic is handled in the weapon class.
Input → Can Fire (character) → Client Fire Weapon
→ Can Fire (weapon) → Switch(mode)
For Single fire we call the Semi Auto Firing
.
Single Autonomous Firing
executes a macro that checks firing conditions. It’s conditions are purely about the states of the weapon. No consideration for character movement or environment.
Upon meeting macro conditions we sequence through the firing logic (projectile prep) and then call the Obj Pool for a projectile. The Semi Auto ROF Timer
is called directly after which sets bIsFiring?
to True. The server is RPC’d on the next sequence step.