REGISTER_WEAPON(DEVASTATOR, devastator, NEW(Devastator));
#ifdef SVQC
-.float rl_release;
+.float rl_release[MAX_WEAPONSLOTS];
.float rl_detonate_later;
#endif
#endif
{
if(this.realowner && this.realowner.lastrocket == this)
{
- this.realowner.lastrocket = NULL;
+ for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ {
+ .entity weaponentity = weaponentities[slot];
+ if(this.realowner.(weaponentity).lastrocket == this)
+ this.realowner.(weaponentity).lastrocket = NULL;
+ }
// this.realowner.rl_release = 1;
}
}
void W_Devastator_RemoteExplode(entity this, .entity weaponentity)
{
if(!IS_DEAD(this.realowner))
- if(this.realowner.lastrocket)
+ if(this.realowner.(weaponentity).lastrocket)
{
if((this.spawnshieldtime >= 0)
? (time >= this.spawnshieldtime) // timer
// laser guided, or remote detonation
if(PS(this.realowner).m_weapon == WEP_DEVASTATOR)
{
- if(this == this.realowner.lastrocket)
- if(!this.realowner.rl_release)
+ .entity weaponentity = this.weaponentity_fld;
+ int slot = weaponslot(weaponentity);
+
+ if(this == this.realowner.(weaponentity).lastrocket)
+ if(!this.realowner.rl_release[slot])
if(!PHYS_INPUT_BUTTON_ATCK2(this))
if(WEP_CVAR(devastator, guiderate))
if(time > this.pushltime)
}
}
- .entity weaponentity = weaponentities[0]; // TODO: unhardcode
if(this.rl_detonate_later)
W_Devastator_RemoteExplode(this, weaponentity);
}
Send_Effect(EFFECT_ROCKET_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
entity missile = WarpZone_RefSys_SpawnSameRefSys(actor);
+ missile.weaponentity_fld = weaponentity;
missile.owner = missile.realowner = actor;
- actor.lastrocket = missile;
+ actor.(weaponentity).lastrocket = missile;
if(WEP_CVAR(devastator, detonatedelay) >= 0)
missile.spawnshieldtime = time + WEP_CVAR(devastator, detonatedelay);
else
if(WEP_CVAR(devastator, reload_ammo) && actor.clip_load < WEP_CVAR(devastator, ammo)) { // forced reload
thiswep.wr_reload(thiswep, actor, weaponentity);
} else {
+ int slot = weaponslot(weaponentity);
if(fire & 1)
{
- if(actor.rl_release || WEP_CVAR(devastator, guidestop))
+ if(actor.rl_release[slot] || WEP_CVAR(devastator, guidestop))
if(weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR(devastator, refire)))
{
W_Devastator_Attack(thiswep, actor, weaponentity);
weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR(devastator, animtime), w_ready);
- actor.rl_release = 0;
+ actor.rl_release[slot] = 0;
}
}
else
- actor.rl_release = 1;
+ actor.rl_release[slot] = 1;
if(fire & 2)
if(PS(actor).m_switchweapon == WEP_DEVASTATOR)
}
METHOD(Devastator, wr_setup, void(entity thiswep, entity actor))
{
- actor.rl_release = 1;
+ for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ actor.rl_release[slot] = 1;
}
METHOD(Devastator, wr_checkammo1, bool(entity thiswep, entity actor))
{
}
METHOD(Devastator, wr_resetplayer, void(entity thiswep, entity actor))
{
- actor.lastrocket = NULL; // stop rocket guiding, no revenge from the grave!
- actor.rl_release = 0;
+ for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+ {
+ .entity weaponentity = weaponentities[slot];
+ actor.(weaponentity).lastrocket = NULL; // stop rocket guiding, no revenge from the grave!
+ actor.rl_release[slot] = 0;
+ }
}
METHOD(Devastator, wr_reload, void(entity thiswep, entity actor, .entity weaponentity))
{