Merge remote branch 'origin/master' into samual/flyingspectators
authorSamual <samual@xonotic.org>
Wed, 20 Apr 2011 02:53:21 +0000 (22:53 -0400)
committerSamual <samual@xonotic.org>
Wed, 20 Apr 2011 02:53:21 +0000 (22:53 -0400)
qcsrc/server/cl_client.qc
qcsrc/server/cl_physics.qc
qcsrc/server/t_teleporters.qc

index a1047ea..cb92b07 100644 (file)
@@ -643,8 +643,8 @@ void PutObserverInServer (void)
        self.iscreature = FALSE;
        self.health = -666;
        self.takedamage = DAMAGE_NO;
-       self.solid = SOLID_NOT;
-       self.movetype = MOVETYPE_NOCLIP;
+       self.solid = SOLID_TRIGGER; // FIXME: SOLID_TRIGGER doesn't work for doors, and SOLID_NOT doesn't work for teleporters... can we do what warpzones do to fix this?
+       self.movetype = MOVETYPE_FLY;
        self.flags = FL_CLIENT | FL_NOTARGET;
        self.armorvalue = 666;
        self.effects = 0;
@@ -673,9 +673,9 @@ void PutObserverInServer (void)
        self.fixangle = TRUE;
        self.crouch = FALSE;
 
-       self.view_ofs = PL_VIEW_OFS;
+       self.view_ofs = '0 0 0'; // so that you can't go inside walls with MOVETYPE_FLY, previously "PL_VIEW_OFS" - for some reason this is diff from normal players
        setorigin (self, spot.origin);
-       setsize (self, '0 0 0', '0 0 0');
+       setsize (self, '-16 -16 -24', '16 16 24'); // so that you can't go inside walls with MOVETYPE_FLY
        self.prevorigin = self.origin;
        self.items = 0;
        self.weapons = 0;
index 9662e0a..f061774 100644 (file)
@@ -892,6 +892,7 @@ void SV_PlayerPhysics()
        }
 
        if(self.flags & FL_ONGROUND)
+       if(self.classname == "player") // no fall sounds for observers thank you very much
        if(self.wasFlying)
        {
                self.wasFlying = 0;
index 93ced82..ce9ef51 100644 (file)
@@ -88,16 +88,19 @@ void TeleportPlayer(entity teleporter, entity player, vector to, vector to_angle
 
        makevectors (to_angles);
 
-       if(self.pushltime < time) // only show one teleport effect per teleporter per 0.2 seconds, for better fps
+       if(player.classname == "player") // don't play sounds or show particles for anything that isn't a player, maybe change later to block only observers
        {
-               if(tflags & TELEPORT_FLAG_SOUND)
-                       sound (player, CHAN_TRIGGER, "misc/teleport.wav", VOL_BASE, ATTN_NORM);
-               if(tflags & TELEPORT_FLAG_PARTICLES)
+               if(self.pushltime < time) // only show one teleport effect per teleporter per 0.2 seconds, for better fps
                {
-                       pointparticles(particleeffectnum("teleport"), player.origin, '0 0 0', 1);
-                       pointparticles(particleeffectnum("teleport"), to + v_forward * 32, '0 0 0', 1);
+                       if(tflags & TELEPORT_FLAG_SOUND)
+                               sound (player, CHAN_TRIGGER, "misc/teleport.wav", VOL_BASE, ATTN_NORM);
+                       if(tflags & TELEPORT_FLAG_PARTICLES)
+                       {
+                               pointparticles(particleeffectnum("teleport"), player.origin, '0 0 0', 1);
+                               pointparticles(particleeffectnum("teleport"), to + v_forward * 32, '0 0 0', 1);
+                       }
+                       self.pushltime = time + 0.2;
                }
-               self.pushltime = time + 0.2;
        }
 
        // Relocate the player
@@ -157,7 +160,7 @@ void Teleport_Touch (void)
        if (self.active != ACTIVE_ACTIVE)
                return;
        
-       if (other.health < 1)
+       if (other.deadflag != DEAD_NO) // Samual: Allow observers, instead of health value lets use deadflags
                return;
        if not(other.flags & FL_CLIENT) // FIXME: Make missiles firable through the teleport too
                return;