#ifdef SVQC
-void spiderbot_rocket_artillery()
-{SELFPARAM();
- self.nextthink = time;
- UpdateCSQCProjectile(self);
+void spiderbot_rocket_artillery(entity this)
+{
+ this.nextthink = time;
+ UpdateCSQCProjectile(this);
}
-void spiderbot_rocket_unguided()
-{SELFPARAM();
+void spiderbot_rocket_unguided(entity this)
+{
vector newdir, olddir;
- self.nextthink = time;
+ this.nextthink = time;
- olddir = normalize(self.velocity);
- newdir = normalize(self.pos1 - self.origin) + randomvec() * autocvar_g_vehicle_spiderbot_rocket_noise;
- self.velocity = normalize(olddir + newdir * autocvar_g_vehicle_spiderbot_rocket_turnrate) * autocvar_g_vehicle_spiderbot_rocket_speed;
+ olddir = normalize(this.velocity);
+ newdir = normalize(this.pos1 - this.origin) + randomvec() * autocvar_g_vehicle_spiderbot_rocket_noise;
+ this.velocity = normalize(olddir + newdir * autocvar_g_vehicle_spiderbot_rocket_turnrate) * autocvar_g_vehicle_spiderbot_rocket_speed;
- UpdateCSQCProjectile(self);
+ UpdateCSQCProjectile(this);
- if (IS_DEAD(self.owner) || self.cnt < time || vdist(self.pos1 - self.origin, <, 16))
- self.use(self, NULL, NULL);
+ if (IS_DEAD(this.owner) || this.cnt < time || vdist(this.pos1 - this.origin, <, 16))
+ this.use(this, NULL, NULL);
}
-void spiderbot_rocket_guided()
-{SELFPARAM();
+void spiderbot_rocket_guided(entity this)
+{
vector newdir, olddir;
- self.nextthink = time;
+ this.nextthink = time;
- if(!self.realowner.vehicle)
- setthink(self, spiderbot_rocket_unguided);
+ if(!this.realowner.vehicle)
+ setthink(this, spiderbot_rocket_unguided);
- crosshair_trace(self.realowner);
- olddir = normalize(self.velocity);
- newdir = normalize(trace_endpos - self.origin) + randomvec() * autocvar_g_vehicle_spiderbot_rocket_noise;
- self.velocity = normalize(olddir + newdir * autocvar_g_vehicle_spiderbot_rocket_turnrate) * autocvar_g_vehicle_spiderbot_rocket_speed;
+ crosshair_trace(this.realowner);
+ olddir = normalize(this.velocity);
+ newdir = normalize(trace_endpos - this.origin) + randomvec() * autocvar_g_vehicle_spiderbot_rocket_noise;
+ this.velocity = normalize(olddir + newdir * autocvar_g_vehicle_spiderbot_rocket_turnrate) * autocvar_g_vehicle_spiderbot_rocket_speed;
- UpdateCSQCProjectile(self);
+ UpdateCSQCProjectile(this);
- if (IS_DEAD(self.owner) || self.cnt < time)
- self.use(self, NULL, NULL);
+ if (IS_DEAD(this.owner) || this.cnt < time)
+ this.use(this, NULL, NULL);
}
void spiderbot_guide_release(entity this)
}
void spiderbot_rocket_do(entity this)
-{;
+{
vector v;
- entity rocket = world;
+ entity rocket = NULL;
if (this.wait != -10)
{
float _dist = (random() * autocvar_g_vehicle_spiderbot_rocket_radius) + vlen(v - trace_endpos);
_dist -= (random() * autocvar_g_vehicle_spiderbot_rocket_radius) ;
rocket.nextthink = time + (_dist / autocvar_g_vehicle_spiderbot_rocket_speed);
- setthink(rocket, vehicles_projectile_explode);
+ setthink(rocket, vehicles_projectile_explode_think);
if(PHYS_INPUT_BUTTON_ATCK2(this.owner) && this.tur_head.frame == 1)
this.wait = -10;
rocket.velocity = spiberbot_calcartillery(v, rocket.pos1, ((h1 < h2) ? h1 : h2));
rocket.movetype = MOVETYPE_TOSS;
rocket.gravity = 1;
- //rocket.think = spiderbot_rocket_artillery;
+ //setthink(rocket, spiderbot_rocket_artillery);
break;
}
rocket.classname = "spiderbot_rocket";