float spread = autocvar_g_rm_laser_spread;
float rndspread = autocvar_g_rm_laser_spread_random;
- float w = self.weapon;
- self.weapon = WEP_ELECTRO.m_id;
+ Weapon w = PS(self).m_weapon;
+ PS(self).m_weapon = WEP_ELECTRO;
W_SetupShot_ProjectileSize (self, '0 0 -3', '0 0 -3', false, 2, SND(CRYLINK_FIRE), CH_WEAPON_A, autocvar_g_rm_laser_damage);
- self.weapon = w;
+ PS(self).m_weapon = w;
Send_Effect(EFFECT_ELECTRO_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
float counter = 0;
float total = 1;
- int w = self.weapon;
- self.weapon = WEP_ELECTRO.m_id;
+ Weapon w = PS(self).m_weapon;
+ PS(self).m_weapon = WEP_ELECTRO;
W_SetupShot_ProjectileSize (self, '0 0 -3', '0 0 -3', false, 2, SND(ELECTRO_FIRE2), CH_WEAPON_A, autocvar_g_rm_laser_damage);
- self.weapon = w;
+ PS(self).m_weapon = w;
Send_Effect(EFFECT_ELECTRO_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
// ugly instagib hack to reuse the fire mode of the laser
makevectors(actor.v_angle);
- int oldwep = actor.weapon; // we can't avoid this hack
- actor.weapon = WEP_BLASTER.m_id;
+ Weapon oldwep = PS(actor).m_weapon; // we can't avoid this hack
+ PS(actor).m_weapon = WEP_BLASTER;
W_Blaster_Attack(
actor,
WEP_BLASTER.m_id | HITTYPE_SECONDARY,
WEP_CVAR_SEC(vaporizer, delay),
WEP_CVAR_SEC(vaporizer, lifetime)
);
- actor.weapon = oldwep;
+ PS(actor).m_weapon = oldwep;
// now do normal refire
weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR_SEC(vaporizer, animtime), w_ready);