]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
some fixes to what can be pushed, teleported, trigger_impulsed
authorRudolf Polzer <divVerent@xonotic.org>
Thu, 30 Jun 2011 09:45:02 +0000 (11:45 +0200)
committerRudolf Polzer <divVerent@xonotic.org>
Thu, 30 Jun 2011 09:45:02 +0000 (11:45 +0200)
qcsrc/server/g_triggers.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/sv_main.qc
qcsrc/server/t_jumppads.qc
qcsrc/server/t_teleporters.qc
qcsrc/warpzonelib/server.qc

index 3ad43b0c36dbf0815ef87145ff6d101aef4e248b..98adee0c179ef346e5c0575729b9e27bb8b9c006 100644 (file)
@@ -1377,24 +1377,7 @@ void trigger_impulse_touch1()
        if (self.active != ACTIVE_ACTIVE) 
                return;
 
-       // FIXME: Better checking for what to push and not.
-       if not(other.iscreature)
-       if (other.classname != "corpse")
-       if (other.classname != "body")
-       if (other.classname != "gib")
-       if (other.classname != "missile")
-       if (other.classname != "rocket")
-       if (other.classname != "casing")
-       if (other.classname != "grenade")
-       if (other.classname != "plasma")
-       if (other.classname != "plasma_prim")
-       if (other.classname != "plasma_chain")
-       if (other.classname != "droppedweapon")
-       if (other.classname != "nexball_basketball")
-       if (other.classname != "nexball_football")
-               return;
-
-       if (other.deadflag && other.iscreature)
+       if(!isPushable(other))
                return;
 
        EXACTTRIGGER_TOUCH;
index c34941e23f030d278b93caa4d913f85dce101474..241dc3a99a1e921d853a6f90f1c99e296f2a5487 100644 (file)
@@ -3127,3 +3127,24 @@ float LostMovetypeFollow(entity ent)
        }
        return 0;
 }
+
+float isPushable(entity e)
+{
+       if(e.iscreature)
+               return TRUE;
+       switch(e.classname)
+       {
+               case "body":
+               case "corpse":
+               case "droppedweapon":
+               case "keepawayball":
+               case "nexball_basketball":
+               case "nexball_football":
+                       return TRUE;
+               case "bullet":
+                       return FALSE;
+       }
+       if (e.projectiledeathtype)
+               return TRUE;
+       return FALSE;
+}
index 0a2c04f93bb48e0fec3e73ded78970a6e6644eaa..fad33a8a103923d3a0a4dd32c748a498be5855d6 100644 (file)
@@ -84,40 +84,39 @@ void CreatureFrame (void)
                                if (dm > 0)
                                        Damage (self, world, world, dm, DEATH_FALL, self.origin, '0 0 0');
                        }
-               }
 
-               if(autocvar_g_maxspeed > 0 && velocity_len > autocvar_g_maxspeed)
-                       Damage (self, world, world, 100000, DEATH_SHOOTING_STAR, self.origin, '0 0 0');
-
-               // play stupid sounds
-               if (!vehic) // vehicles don't get footsteps
-               if (g_footsteps)
-               if (!gameover)
-               if (self.flags & FL_ONGROUND)
-               if (velocity_len > autocvar_sv_maxspeed * 0.6)
-               if (!self.deadflag)
-               if (time < self.lastground + 0.2)
-               {
-                       if((time > self.nextstep) || (time < (self.nextstep - 10.0)))
+                       if(autocvar_g_maxspeed > 0 && velocity_len > autocvar_g_maxspeed)
+                               Damage (self, world, world, 100000, DEATH_SHOOTING_STAR, self.origin, '0 0 0');
+                       // play stupid sounds
+                       if (g_footsteps)
+                       if (!gameover)
+                       if (self.flags & FL_ONGROUND)
+                       if (velocity_len > autocvar_sv_maxspeed * 0.6)
+                       if (!self.deadflag)
+                       if (time < self.lastground + 0.2)
                        {
-                               self.nextstep = time + 0.3 + random() * 0.1;
-                               trace_dphitq3surfaceflags = 0;
-                               tracebox(self.origin, self.mins, self.maxs, self.origin - '0 0 1', MOVE_NOMONSTERS, self);
-                               /*
-                               if(trace_fraction == 1)
-                                       dprint("nohit\n");
-                               else
-                                       dprint(ftos(trace_dphitq3surfaceflags), "\n");
-                               */
-                               if not(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOSTEPS)
+                               if((time > self.nextstep) || (time < (self.nextstep - 10.0)))
                                {
-                                       if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_METALSTEPS)
-                                               GlobalSound(globalsound_metalstep, CHAN_PLAYER, VOICETYPE_PLAYERSOUND);
+                                       self.nextstep = time + 0.3 + random() * 0.1;
+                                       trace_dphitq3surfaceflags = 0;
+                                       tracebox(self.origin, self.mins, self.maxs, self.origin - '0 0 1', MOVE_NOMONSTERS, self);
+                                       /*
+                                       if(trace_fraction == 1)
+                                               dprint("nohit\n");
                                        else
-                                               GlobalSound(globalsound_step, CHAN_PLAYER, VOICETYPE_PLAYERSOUND);
+                                               dprint(ftos(trace_dphitq3surfaceflags), "\n");
+                                       */
+                                       if not(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOSTEPS)
+                                       {
+                                               if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_METALSTEPS)
+                                                       GlobalSound(globalsound_metalstep, CHAN_PLAYER, VOICETYPE_PLAYERSOUND);
+                                               else
+                                                       GlobalSound(globalsound_step, CHAN_PLAYER, VOICETYPE_PLAYERSOUND);
+                                       }
                                }
                        }
                }
+
                self.oldvelocity = self.velocity;
        }
        self = oldself;
index 4712d5929f5f714d2ba5c6c9f8fdd87d48f9854f..a61c6a79decd6c01d0e63317ca5b79b5db4cf783 100644 (file)
@@ -130,17 +130,21 @@ void trigger_push_touch()
        if (self.active == ACTIVE_NOT)
                return;
 
-       // FIXME: add a .float for whether an entity should be tossed by jumppads
-       if (!other.iscreature)
-       if (other.classname != "corpse")
+       if not(other.iscreature)
        if (other.classname != "body")
-       if (other.classname != "gib")
        if (other.classname != "casing")
+       if (other.classname != "corpse")
        if (other.classname != "droppedweapon")
+       if (other.classname != "gib")
        if (other.classname != "keepawayball")
+       if (other.classname != "nexball_basketball")
+       if (other.classname != "nexball_football")
        if (!other.projectiledeathtype || other.classname == "bullet")
                return;
 
+       if(!isPushable(other))
+               return;
+
        if (other.deadflag && other.iscreature)
                return;
 
index a2836264de0c2d7bc1d90f286b0094773edcbb93..5d87af3e299f3bb28e690facdb513c41decd3b33 100644 (file)
@@ -148,9 +148,14 @@ void Teleport_Touch (void)
        if (self.active != ACTIVE_ACTIVE)
                return;
        
-       if (other.health < 1)
+       if not(other.iscreature)
                return;
-       if not(other.flags & FL_CLIENT) // FIXME: Make missiles firable through the teleport too
+
+       // for gameplay: vehicles can't teleport
+       if (other.vehicle_flags & VHF_ISVEHICLE)
+               return;
+
+       if (other.deadflag != DEAD_NO)
                return;
 
        if(self.team)
index 2bcb579ccf0cdffc2d8bb8e4cd2cd4fc841379b0..861b2e01f863cdb618adab1613d1df7d260e0548 100644 (file)
@@ -156,7 +156,7 @@ void WarpZone_Touch (void)
                return;
 
        // FIXME needs a better check to know what is safe to teleport and what not
-       if(other.movetype == MOVETYPE_NONE || other.movetype == MOVETYPE_FOLLOW)
+       if(other.movetype == MOVETYPE_NONE || other.movetype == MOVETYPE_FOLLOW || other.tag_entity)
                return;
 
        if(WarpZoneLib_ExactTrigger_Touch())