Better "drop to ground" for vehicles and moving turrets.
authortzork <tzork@f962a42d-fe04-0410-a3ab-8c8b0445ebaa>
Thu, 18 Feb 2010 21:28:24 +0000 (21:28 +0000)
committertzork <tzork@f962a42d-fe04-0410-a3ab-8c8b0445ebaa>
Thu, 18 Feb 2010 21:28:24 +0000 (21:28 +0000)
git-svn-id: svn://svn.icculus.org/nexuiz/trunk@8652 f962a42d-fe04-0410-a3ab-8c8b0445ebaa

data/qcsrc/server/tturrets/units/unit_ewheel.qc
data/qcsrc/server/tturrets/units/unit_walker.qc
data/qcsrc/server/vehicles/racer.qc
data/qcsrc/server/vehicles/spiderbot.qc

index e3ea904..3f7acda 100644 (file)
@@ -176,9 +176,9 @@ void ewheel_postthink()
     self.angles_x = anglemods(self.angles_x);
     self.angles_y = anglemods(self.angles_y);
 
-    self.angles_x *= -1;
-    makevectors(self.angles);
-    self.angles_x *= -1;
+    //self.angles_x *= -1;
+    fixedmakevectors(self.angles);
+    //self.angles_x *= -1;
 
     wish_angle = normalize(self.steerto);
     wish_angle = vectoangles(wish_angle);
index e459d32..14dd163 100644 (file)
@@ -369,9 +369,9 @@ void walker_fire_rocket(vector org)
     entity rocket;
 
 
-    self.angles_x *= -1;
-    makevectors(self.angles);
-    self.angles_x *= -1;
+    //self.angles_x *= -1;
+    fixedmakevectors(self.angles);
+    //self.angles_x *= -1;
 
     te_explosion (org);
 
@@ -586,9 +586,9 @@ float walker_attack_rockets()
 void walker_postthink()
 {
 
-    self.angles_x *= -1;
-    makevectors(self.angles);
-    self.angles_x *= -1;
+    //self.angles_x *= -1;
+    fixedmakevectors(self.angles);
+    //self.angles_x *= -1;
 
     if ((self.spawnflags & TSF_NO_PATHBREAK) && self.pathcurrent)
         walker_move_path();
@@ -718,9 +718,7 @@ void turret_walker_dinit()
         return;
     }
 
-
     self.damage_flags |= TFL_DMG_DEATH_NOGIBS;
-
     self.target_select_flags   = TFL_TARGETSELECT_PLAYERS | TFL_TARGETSELECT_RANGELIMTS | TFL_TARGETSELECT_TEAMCHECK | TFL_TARGETSELECT_LOS;
     self.target_validate_flags = TFL_TARGETSELECT_PLAYERS | TFL_TARGETSELECT_RANGELIMTS | TFL_TARGETSELECT_TEAMCHECK | TFL_TARGETSELECT_LOS;
 
@@ -737,7 +735,8 @@ void turret_walker_dinit()
     setsize(self, WALKER_MIN, WALKER_MAX);
 
     setorigin(self,self.origin);
-    traceline(self.origin + '0 0 128', self.origin - '0 0 10000', MOVE_NORMAL, self);
+    //traceline(self.origin + '0 0 128', self.origin - '0 0 10000', MOVE_NORMAL, self);
+    tracebox(self.origin + '0 0 128', self.mins,self.maxs,self.origin - '0 0 10000', MOVE_NORMAL, self);
 
     setorigin(self.wkr_spawn, trace_endpos + '0 0 4');
     setorigin(self, self.wkr_spawn.origin);
index e769e06..c82c369 100644 (file)
@@ -769,6 +769,9 @@ void racer_die()
 void racer_dinit()
 {
 
+    tracebox(self.origin + '0 0 100', RACER_MIN * 0.5, RACER_MAX * 0.5, self.origin - '0 0 10000', MOVE_WORLDONLY, self);
+    setorigin(self,trace_endpos);
+
     if (self.netname == "")
         self.netname     = "Race PoD";
 
@@ -821,6 +824,7 @@ void spawnfunc_vehicle_racer()
 
     self.vehicle_flags      = VHF_HASSHIELD | VHF_SHIELDREGEN;
 
+    /*
     traceline(self.origin,self.origin - '0 0 2048',MOVE_WORLDONLY,self);
     if(trace_startsolid)
     {
@@ -833,6 +837,7 @@ void spawnfunc_vehicle_racer()
             return;
         }
     }
+    */
 
     if(trace_fraction != 1.0)
         setorigin(self,trace_endpos + '0 0 128');
index afcf03c..b50aa4a 100644 (file)
@@ -1,5 +1,6 @@
 #define spiderbot_MIN '-75 -75 0'
-#define spiderbot_MAX '75 75 100'
+//#define
+const vector spiderbot_MAX  = '75 75 100';
 #define spiderbot_spawnpnt wkr_spawn
 
 void spiderbot_exit(float eject);
@@ -627,7 +628,7 @@ void spiderbot_spawn()
     self.flags      |= FL_NOTARGET;
     self.vehicle_hudmodel.viewmodelforclient = self;
 
-    setorigin(self,self.spiderbot_spawnpnt.origin);
+    setorigin(self,self.spiderbot_spawnpnt.origin + '0 0 1.25' * spiderbot_MAX_z);
     self.angles = self.spiderbot_spawnpnt.angles;
 
     if (self.team == COLOR_TEAM1)
@@ -682,9 +683,15 @@ void vewhicle_spiderbot_dinit()
     self.spiderbot_spawnpnt = spawn();
     self.spiderbot_spawnpnt.angles = self.angles;
 
-    traceline(self.origin + '0 0 16', self.origin - '0 0 10000', MOVE_WORLDONLY, self);
-    setorigin(self.spiderbot_spawnpnt,trace_endpos + '0 0 4');
-    setorigin(self,self.spiderbot_spawnpnt.origin);
+    setorigin(self,self.origin);
+    dprint("ORG1:",vtos(self.origin));
+    //traceline(self.origin + '0 0 100', self.origin - '0 0 10000', MOVE_WORLDONLY, self);
+    tracebox(self.origin + '0 0 100', spiderbot_MIN, spiderbot_MAX, self.origin - '0 0 10000', MOVE_WORLDONLY, self);
+    setorigin(self.spiderbot_spawnpnt,trace_endpos);
+
+    dprint("ORG2:",vtos(self.origin),"\n");
+
+    //setorigin(self.spiderbot_spawnpnt,self.origin);
 
     if(self.team && !teamplay)
         self.team = 0;