self.dmg_save = spectatee.dmg_save;
self.dmg_inflictor = spectatee.dmg_inflictor;
self.angles = spectatee.v_angle;
- self.fixangle = TRUE;
+ //self.fixangle = TRUE;
setorigin(self, spectatee.origin);
setsize(self, spectatee.mins, spectatee.maxs);
SetZoomState(spectatee.zoomstate);
{
setorigin(self, spectatee.origin);
self.velocity = spectatee.vehicle.velocity;
- self.v_angle += spectatee.vehicle.angles;
+ //self.v_angle += spectatee.vehicle.angles;
//self.v_angle_x *= -1;
self.vehicle_health = spectatee.vehicle_health;
self.vehicle_shield = spectatee.vehicle_shield;
void racer_exit(float eject)
{
+ vector spot;
+
self.think = racer_think;
self.nextthink = time;
self.movetype = MOVETYPE_TOSS;
makevectors(self.angles);
if(eject)
{
- setorigin(self.owner, self.origin + v_forward * 100 + v_up * 32);
+ spot = self.origin + v_forward * 100 + '0 0 64';
+ spot = vehicles_findgoodexit(spot);
+ setorigin(self.owner , spot);
self.owner.velocity = (v_up + v_forward * 0.25) * 750;
}
else
{
- setorigin(self.owner, self.origin - v_forward * 100 + v_up * 32);
- self.owner.velocity = v_forward * -150;
+ spot = self.origin - v_forward * 200 + '0 0 64';
+ spot = vehicles_findgoodexit(spot);
+ setorigin(self.owner , spot);
}
+
self.owner = world;
}
void raptor_exit(float eject)
{
+ vector spot;
self.tur_head.exteriormodeltoclient = world;
if(self.deadflag == DEAD_NO)
makevectors(self.angles);
if(eject)
{
- setorigin(self.owner,self.origin + v_forward * 100 + '0 0 64');
+ spot = self.origin + v_forward * 100 + '0 0 64';
+ spot = vehicles_findgoodexit(spot);
+ setorigin(self.owner , spot);
self.owner.velocity = (v_up + v_forward * 0.25) * 750;
}
else
- setorigin(self.owner,self.origin - v_forward * 200 + '0 0 64');
-
+ {
+ spot = self.origin - v_forward * 200 + '0 0 64';
+ spot = vehicles_findgoodexit(spot);
+ setorigin(self.owner , spot);
+ }
+
self.owner = world;
}
sound (self, CHAN_VOICE, "vehicles/spiderbot_walk.wav", VOL_BASE, ATTN_NORM);
//dprint("spiderbot_walk:", ftos(soundlength("vehicles/spiderbot_walk.wav")), "\n");
}
-
}
else if(player.movement_y != 0)
{
void spiderbot_exit(float eject)
{
entity e;
-
+ vector spot;
+
e = findchain(classname,"spiderbot_rocket");
while(e)
{
makevectors(self.angles);
if(eject)
{
- setorigin(self.owner ,self.origin + v_forward * 100 + '0 0 64');
+ spot = self.origin + v_forward * 100 + '0 0 64';
+ spot = vehicles_findgoodexit(spot);
+ setorigin(self.owner , spot);
self.owner.velocity = (v_up + v_forward * 0.25) * 750;
}
else
- setorigin(self.owner, self.origin - v_forward * 200 + '0 0 64');
-
+ {
+ spot = self.origin - v_forward * 200 + '0 0 64';
+ spot = vehicles_findgoodexit(spot);
+ setorigin(self.owner , spot);
+ }
+
self.owner = world;
}
self.vehicle_enter();
}
+vector vehicles_findgoodexit(vector prefer_spot)
+{
+ vector exitspot;
+ float mysize;
+
+ tracebox(self.origin + '0 0 32', PL_MIN, PL_MAX, prefer_spot, MOVE_NORMAL, self.owner);
+ if(trace_fraction == 1.0 && !trace_startsolid && !trace_allsolid)
+ return prefer_spot;
+
+ mysize = vlen(self.maxs - self.mins);
+ float i;
+ vector v, v2;
+ v2 = 0.5 * (self.absmin + self.absmax);
+ for(i = 0; i < 100; ++i)
+ {
+ v = randomvec();
+ v_z = 0;
+ v = v2 + normalize(v) * mysize;
+ tracebox(v2, PL_MIN, PL_MAX, v, MOVE_NORMAL, self.owner);
+ if(trace_fraction == 1.0 && !trace_startsolid && !trace_allsolid)
+ return v;
+ }
+
+ /*
+ exitspot = (self.origin + '0 0 48') + v_forward * mysize;
+ tracebox(self.origin + '0 0 32', PL_MIN, PL_MAX, exitspot, MOVE_NORMAL, self.owner);
+ if(trace_fraction == 1.0 && !trace_startsolid && !trace_allsolid)
+ return exitspot;
+
+ exitspot = (self.origin + '0 0 48') - v_forward * mysize;
+ tracebox(self.origin + '0 0 32', PL_MIN, PL_MAX, exitspot, MOVE_NORMAL, self.owner);
+ if(trace_fraction == 1.0 && !trace_startsolid && !trace_allsolid)
+ return exitspot;
+
+ exitspot = (self.origin + '0 0 48') + v_right * mysize;
+ tracebox(self.origin + '0 0 32', PL_MIN, PL_MAX, exitspot, MOVE_NORMAL, self.owner);
+ if(trace_fraction == 1.0 && !trace_startsolid && !trace_allsolid)
+ return exitspot;
+
+ exitspot = (self.origin + '0 0 48') - v_right * mysize;
+ tracebox(self.origin + '0 0 32', PL_MIN, PL_MAX, exitspot, MOVE_NORMAL, self.owner);
+ if(trace_fraction == 1.0 && !trace_startsolid && !trace_allsolid)
+ return exitspot;
+ */
+
+ return self.origin;
+}
+
void vehicles_exit(float eject)
{
self.flags |= FL_NOTARGET;