From: Samual Date: Sun, 9 Jan 2011 00:13:12 +0000 (-0500) Subject: Experimental - Lets make it so that spectators aren't noclip anymore, this way they... X-Git-Tag: xonotic-v0.5.0~109^2~27 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=4e74f9af305cc057ccf7394d4d21488bfa6ae7f9;p=xonotic%2Fxonotic-data.pk3dir.git Experimental - Lets make it so that spectators aren't noclip anymore, this way they can't go outside of map. Still one major issue, you can't go through doorways and such on maps like red-planet, which definitely stops this from being acceptable. --- diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index cb2d2ed3d..76dd8080d 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -638,8 +638,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; @@ -668,9 +668,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; diff --git a/qcsrc/server/cl_physics.qc b/qcsrc/server/cl_physics.qc index 7a93468d9..5163c6f94 100644 --- a/qcsrc/server/cl_physics.qc +++ b/qcsrc/server/cl_physics.qc @@ -891,6 +891,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; diff --git a/qcsrc/server/t_teleporters.qc b/qcsrc/server/t_teleporters.qc index 93ced8267..ce9ef511a 100644 --- a/qcsrc/server/t_teleporters.qc +++ b/qcsrc/server/t_teleporters.qc @@ -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;