]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge remote branch 'origin/master' into samual/flyingspectators
authorSamual <samual@xonotic.org>
Tue, 3 May 2011 17:17:34 +0000 (13:17 -0400)
committerSamual <samual@xonotic.org>
Tue, 3 May 2011 17:17:34 +0000 (13:17 -0400)
1  2 
qcsrc/warpzonelib/server.qc

index d39cd91879f7f40627d17fcfff87ac33f48afd3a,29f5dc8db11aaf218354895ed5bba94f53e76397..f6354a84e3910b199c0235f776e333e7da40e189
@@@ -33,6 -33,15 +33,15 @@@ void WarpZone_TeleportPlayer(entity tel
        WarpZone_PostTeleportPlayer_Callback(player);
  }
  
+ float WarpZone_Teleported_Send(entity to, float sf)
+ {
+       WriteByte(MSG_ENTITY, ENT_CLIENT_WARPZONE_TELEPORTED);
+       WriteCoord(MSG_ENTITY, self.angles_x);
+       WriteCoord(MSG_ENTITY, self.angles_y);
+       WriteCoord(MSG_ENTITY, self.angles_z);
+       return TRUE;
+ }
  float WarpZone_Teleport(entity player)
  {
        vector o0, a0, v0, o1, a1, v1;
        WarpZone_StoreProjectileData(player);
        player.warpzone_teleport_time = time;
        player.warpzone_teleport_zone = self;
+ #ifndef WARPZONE_USE_FIXANGLE
+       // instead of fixangle, send the transform to the client for smoother operation
+       player.fixangle = FALSE;
+       entity ts = spawn();
+       setmodel(ts, "null");
+       ts.SendEntity = WarpZone_Teleported_Send;
+       ts.SendFlags = 0xFFFFFF;
+       ts.drawonlytoclient = player;
+       ts.think = SUB_Remove;
+       ts.nextthink = time + 1;
+       ts.owner = player;
+       ts.enemy = self;
+       ts.effects = EF_NODEPTHTEST;
+       ts.classname = "warpzone_teleported";
+       ts.angles = self.warpzone_transform;
+ #endif
  
        return 1;
  }
@@@ -607,46 -633,40 +633,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;