#include "campaign.qh"
#include "command/common.qh"
#include "scores_rules.qh"
+#include "weapons/common.qh"
#include "bot/api.qh"
for (int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
{
.entity weaponentity = weaponentities[slot];
- entity oldwep = this.(weaponentity);
CL_SpawnWeaponentity(this, weaponentity);
- if(oldwep && oldwep.owner == this)
- this.(weaponentity).m_gunalign = oldwep.m_gunalign;
}
this.alpha = default_player_alpha;
this.colormod = '1 1 1' * autocvar_g_player_brightness;
if (CS(this).impulse) ImpulseCommands(this);
+ W_ResetGunAlign(this, CS(this).cvar_cl_gunalign);
for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
{
.entity weaponentity = weaponentities[slot];
.int items_added;
.string shootfromfixedorigin;
+.bool dualwielding_prev;
bool PlayerThink(entity this)
{
if (game_stopped || intermission_running) {
stuffcmd(this, sprintf("\ncl_shootfromfixedorigin \"%s\"\n", autocvar_g_shootfromfixedorigin));
}
+ // reset gun alignment when dual wielding status changes
+ // to ensure guns are always aligned right and left
+ bool dualwielding = W_DualWielding(this);
+ if(this.dualwielding_prev != dualwielding)
+ {
+ W_ResetGunAlign(this, CS(this).cvar_cl_gunalign);
+ this.dualwielding_prev = dualwielding;
+ }
+
// LordHavoc: allow firing on move frames (sub-ticrate), this gives better timing on slow servers
//if(frametime)
{