ATTRIB(PlayerState, m_weapon, Weapon, Weapons_from(-1))
METHOD(PlayerState, ps_push, void(PlayerState this))
{
+ STAT(SWITCHINGWEAPON, this.m_client) = this.m_switchingweapon.m_id;
STAT(SWITCHWEAPON, this.m_client) = this.m_switchweapon.m_id;
}
ENDCLASS(PlayerState)
void PlayerState_attach(entity this)
{
- LOG_INFO("Attached\n");
this._ps = NEW(PlayerState, this);
}
.vector weaponentity_glowmod;
//.int weapon; // current weapon
-#ifdef SVQC
-.int switchingweapon = _STAT(SWITCHINGWEAPON);
-#endif
.string weaponname; // name of .weapon
.vector spawnorigin; // for casings
self.weapon = 0;
self.weaponname = "";
- self.switchingweapon = 0;
+ PS(self).m_switchingweapon = WEP_Null;
self.weaponmodel = "";
for (int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
{
this.cnt = -1; // W_LastWeapon will not complain
this.weapon = 0;
this.weaponname = "";
- this.switchingweapon = 0;
+ PS(this).m_switchingweapon = WEP_Null;
if (!warmup_stage && !this.alivetime)
this.alivetime = time;
self.pressedkeys = spectatee.pressedkeys;
self.weapons = spectatee.weapons;
PS(self).m_switchweapon = PS(spectatee).m_switchweapon;
- self.switchingweapon = spectatee.switchingweapon;
+ PS(self).m_switchingweapon = PS(spectatee).m_switchingweapon;
self.weapon = spectatee.weapon;
self.vortex_charge = spectatee.vortex_charge;
self.vortex_chargepool_ammo = spectatee.vortex_chargepool_ammo;
if (actor.weapon != -1)
{
actor.weapon = 0;
- actor.switchingweapon = 0;
+ PS(actor).m_switchingweapon = WEP_Null;
}
entity this = actor.(weaponentity);
if (this)
if (PS(actor).m_switchweapon.m_id == 0)
{
actor.weapon = 0;
- actor.switchingweapon = 0;
+ PS(actor).m_switchingweapon = WEP_Null;
this.state = WS_CLEAR;
actor.weaponname = "";
// actor.items &= ~IT_AMMO;
{
// end switching!
Weapon newwep = PS(actor).m_switchweapon;
- actor.switchingweapon = newwep.m_id;
+ PS(actor).m_switchingweapon = newwep;
// the two weapon entities will notice this has changed and update their models
actor.weapon = newwep.m_id;
case WS_DROP:
{
// in dropping phase we can switch at any time
- actor.switchingweapon = PS(actor).m_switchweapon.m_id;
+ PS(actor).m_switchingweapon = PS(actor).m_switchweapon;
break;
}
case WS_READY:
{
// start switching!
- actor.switchingweapon = PS(actor).m_switchweapon.m_id;
+ PS(actor).m_switchingweapon = PS(actor).m_switchweapon;
entity oldwep = Weapons_from(actor.weapon);
// set up weapon switch think in the future, and start drop anim