]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge remote branch 'origin/master' into samual/flyingspectators
authorSamual <samual@xonotic.org>
Fri, 29 Apr 2011 05:33:14 +0000 (01:33 -0400)
committerSamual <samual@xonotic.org>
Fri, 29 Apr 2011 05:33:14 +0000 (01:33 -0400)
1  2 
qcsrc/server/cl_client.qc
qcsrc/server/cl_physics.qc
qcsrc/warpzonelib/server.qc

index 625646c5966a87ad315060ff12d22f3f03dba340,b3d326264e0a2a702843ae0b874714d6eb11f0cf..8a3aea874bb867084483958b808c27ff6d843449
@@@ -328,13 -328,28 +328,28 @@@ entity SelectSpawnPoint (float anypoint
        if(anypoint)
                teamcheck = -1;
        else if(have_team_spawns > 0)
-               teamcheck = self.team; // MUST be team
-       else if(have_team_spawns == 0 && have_noteam_spawns)
+       {
+               if(have_team_spawns_forteam[self.team] == 0)
+               {
+                       // we request a spawn for a team, and we have team
+                       // spawns, but that team has no spawns?
+                       if(have_team_spawns[0])
+                               // try noteam spawns
+                               teamcheck = 0;
+                       else
+                               // if not, any spawn has to do
+                               teamcheck = -1;
+               }
+               else
+                       teamcheck = self.team; // MUST be team
+       }
+       else if(have_team_spawns == 0 && have_team_spawns[0])
                teamcheck = 0; // MUST be noteam
        else
                teamcheck = -1;
                // if we get here, we either require team spawns but have none, or we require non-team spawns and have none; use any spawn then
  
        // get the list of players
        playerlist = findchain(classname, "player");
        // get the entire list of spots
@@@ -644,7 -659,7 +659,7 @@@ void PutObserverInServer (void
        self.health = -666;
        self.takedamage = DAMAGE_NO;
        self.solid = SOLID_NOT;
 -      self.movetype = MOVETYPE_NOCLIP;
 +      self.movetype = MOVETYPE_FLY;
        self.flags = FL_CLIENT | FL_NOTARGET;
        self.armorvalue = 666;
        self.effects = 0;
        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;
@@@ -1524,7 -1539,7 +1539,7 @@@ void ClientConnect (void
        DecodeLevelParms();
  
  #ifdef WATERMARK
-       sprint(self, strcat("^4SVQC Build information: ", WATERMARK(), "\n"));
+       sprint(self, strcat("^4SVQC Build information: ^1", WATERMARK(), "\n"));
  #endif
  
        self.classname = "player_joining";
@@@ -2614,6 -2629,8 +2629,8 @@@ void() nexball_setstatus
  .float items_added;
  void PlayerPreThink (void)
  {
+       WarpZone_PlayerPhysics_FixVAngle();
        self.stat_game_starttime = game_starttime;
        self.stat_allow_oldnexbeam = autocvar_g_allow_oldnexbeam;
        self.stat_leadlimit = autocvar_leadlimit;
                        return;                                 // the think tics
                }
  
-               if(self.teleport_time)
-               if(time > self.teleport_time)
-               {
-                       self.teleport_time = 0;
-                       self.effects = self.effects - (self.effects & EF_NODRAW);
-               }
                if(frametime > 0) // don't do this in cl_movement frames, just in server ticks
                        UpdateSelectedPlayer();
  
index f0617740e654210a45af5754dc526b5aaef48625,08368676d0055791a10e7d6a9c7135a5ff568ceb..9fbec9299deeeaebbc32aed74d497f75f3152941
@@@ -667,6 -667,8 +667,8 @@@ void SV_PlayerPhysics(
        float buttons_prev;
        float not_allowed_to_move;
        string c;
+       WarpZone_PlayerPhysics_FixVAngle();
        
        maxspd_mod = 1;
        if(g_minstagib && (self.items & IT_INVINCIBLE))
        }
  
        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 85e17e13303befd1cb44b922a967b4a4e2cef0af,dee94fd8565d0655388842bacecfccd81bacd34f..d39cd91879f7f40627d17fcfff87ac33f48afd3a
@@@ -1,5 -1,6 +1,6 @@@
  .vector warpzone_oldorigin, warpzone_oldvelocity, warpzone_oldangles;
  .float warpzone_teleport_time;
+ .entity warpzone_teleport_zone;
  
  void WarpZone_StoreProjectileData(entity e)
  {
@@@ -90,6 -91,7 +91,7 @@@ float WarpZone_Teleport(entity player
        WarpZone_TeleportPlayer(self, player, o1 - player.view_ofs, a1, v1);
        WarpZone_StoreProjectileData(player);
        player.warpzone_teleport_time = time;
+       player.warpzone_teleport_zone = self;
  
        return 1;
  }
@@@ -605,46 -607,40 +607,46 @@@ void WarpZone_StartFrame(
                WarpZones_Reconnect();
        }
  
 -      if(warpzone_warpzones_exist)
 +      entity oldself, oldother;
 +      oldself = self;
 +      oldother = other;
 +      for(e = world; (e = nextent(e)); )
        {
 -              entity oldself, oldother;
 -              oldself = self;
 -              oldother = other;
 -              for(e = world; (e = nextent(e)); )
 +              if(warpzone_warpzones_exist) { WarpZone_StoreProjectileData(e); }
 +              
 +              float f = clienttype(e);
 +              if(f == CLIENTTYPE_REAL)
                {
 -                      WarpZone_StoreProjectileData(e);
 -                      float f;
 -                      f = clienttype(e);
 -                      if(f == CLIENTTYPE_REAL)
 +                      if(e.solid == SOLID_NOT) // not spectating?
 +                      if(e.movetype == MOVETYPE_NOCLIP || e.movetype == MOVETYPE_FLY) // not spectating? (this is to catch observers)
                        {
 -                              if(e.solid != SOLID_NOT) // not spectating?
 -                                      continue;
 -                              if(e.movetype != MOVETYPE_NOCLIP && e.movetype != MOVETYPE_FLY) // not spectating? (this is to catch observers)
 -                                      continue;
 -                              self = WarpZone_Find(e.origin + e.mins, e.origin + e.maxs);
 -                              if(!self)
 -                                      continue;
 -                              other = e;
 -                              if(WarpZoneLib_ExactTrigger_Touch())
 -                                      continue;
 -                              WarpZone_Teleport(e); // NOT triggering targets by this!
 +                              other = e; // player
 +                      
 +                              // warpzones
 +                              if(warpzone_warpzones_exist) { 
 +                              self = WarpZone_Find(e.origin + e.mins, e.origin + e.maxs); 
 +                              if(self)
 +                              if(!WarpZoneLib_ExactTrigger_Touch())
 +                                      WarpZone_Teleport(e); } // NOT triggering targets by this!
 +                      
 +                              // teleporters
 +                              self = Teleport_Find(e.origin + e.mins, e.origin + e.maxs);
 +                              if(self)
 +                              if(!WarpZoneLib_ExactTrigger_Touch())
 +                                      Simple_TeleportPlayer(self, other); // NOT triggering targets by this!
                        }
 -                      if(f == CLIENTTYPE_NOTACLIENT)
 -                      {
 +              }
 +              
 +              if(f == CLIENTTYPE_NOTACLIENT)
 +              {
 +                      if(warpzone_warpzones_exist)
                                for(; (e = nextent(e)); )
                                        WarpZone_StoreProjectileData(e);
 -                              break;
 -                      }
 +                      break;
                }
 -              self = oldself;
 -              other = oldother;
        }
 +      self = oldself;
 +      other = oldother;
  }
  
  .float warpzone_reconnecting;
@@@ -691,3 -687,16 +693,16 @@@ void spawnfunc_target_warpzone_reconnec
  {
        spawnfunc_trigger_warpzone_reconnect(); // both names make sense here :(
  }
+ void WarpZone_PlayerPhysics_FixVAngle(void)
+ {
+ #ifndef WARPZONE_DONT_FIX_VANGLE
+       if(clienttype(self) == CLIENTTYPE_REAL)
+       if(self.v_angle_z <= 360) // if not already adjusted
+       if(time - self.ping * 0.001 < self.warpzone_teleport_time)
+       {
+               self.v_angle = WarpZone_TransformVAngles(self.warpzone_teleport_zone, self.v_angle);
+               self.v_angle_z += 720; // mark as adjusted
+       }
+ #endif
+ }