]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Network spawn points to client and crudely (for now) do an effect for them
authorSamual Lenks <samual@xonotic.org>
Fri, 8 Feb 2013 05:41:29 +0000 (00:41 -0500)
committerSamual Lenks <samual@xonotic.org>
Fri, 8 Feb 2013 05:41:29 +0000 (00:41 -0500)
qcsrc/client/Main.qc
qcsrc/common/constants.qh
qcsrc/server/spawnpoints.qc

index 3d8225442dbd60e1212c7b43cafe28af9b0810f6..163301b95ad133f8d2c4a8ac4639725ba45f4aed 100644 (file)
@@ -693,6 +693,32 @@ void Ent_ReadAccuracy(void)
        }
 }
 
+void Spawn_Draw(void)
+{
+       pointparticles(particleeffectnum("EF_STARDUST"), self.origin, '0 0 2', bound(0, frametime, 0.1));
+}
+
+void Ent_ReadSpawnPoint(float is_new)
+{
+       self.team = ReadByte();
+       self.origin_x = ReadShort();
+       self.origin_y = ReadShort();
+       self.origin_z = ReadShort();
+
+       //setsize(self, PL_MIN, PL_MAX);
+
+       //droptofloor();
+
+       //self.mdl = "models/domination/dom_unclaimed.md3";
+       //precache_model(self.mdl);
+       //setmodel(self, self.mdl);
+       self.drawmask = MASK_NORMAL;
+       self.movetype = MOVETYPE_NOCLIP;
+       self.draw = Spawn_Draw;
+
+       print(ftos(is_new), " - read a spawnpoint at ", vtos(self.origin), ", bitches.\n");
+}
+
 // CSQC_Ent_Update : Called every frame that the server has indicated an update to the SSQC / CSQC entity has occured.
 // The only parameter reflects if the entity is "new" to the client, meaning it just came into the client's PVS.
 void Ent_RadarLink();
@@ -778,7 +804,7 @@ void CSQC_Ent_Update(float bIsNewEntity)
                case ENT_CLIENT_MODEL: CSQCModel_Read(bIsNewEntity); break;
                case ENT_CLIENT_ITEM: ItemRead(bIsNewEntity); break;  
                case ENT_CLIENT_BUMBLE_RAYGUN: bumble_raygun_read(bIsNewEntity); break;
-               //case ENT_CLIENT_SPAWNPOINT: Ent_ReadSpawnPoint(bIsNewEntity); break;
+               case ENT_CLIENT_SPAWNPOINT: Ent_ReadSpawnPoint(bIsNewEntity); break;
                default:
                        //error(strcat(_("unknown entity type in CSQC_Ent_Update: %d\n"), self.enttype));
                        error(sprintf(_("Unknown entity type in CSQC_Ent_Update (enttype: %d, edict: %d, classname: %s)\n"), self.enttype, num_for_edict(self), self.classname));
index bc4b7bda102c714dc9547b55386cd6e6e5b2cdad..44c8c1442117ad98b29566e8ea903b70da3d7caf 100644 (file)
@@ -99,7 +99,7 @@ const float ENT_CLIENT_WARPZONE_TELEPORTED = 32;
 const float ENT_CLIENT_MODEL = 33;
 const float ENT_CLIENT_ITEM = 34;
 const float ENT_CLIENT_BUMBLE_RAYGUN = 35;
-//const float ENT_CLIENT_SPAWNPOINT = 36;
+const float ENT_CLIENT_SPAWNPOINT = 36;
 
 const float ENT_CLIENT_TURRET = 40;
 const float ENT_CLIENT_AUXILIARYXHAIR = 50;
index 197eb30bf378d70ff50a849ee2658e651ed388f9..c0846b74279f8042d4c745b0b36afcab8b2f2e7a 100644 (file)
@@ -1,3 +1,13 @@
+float Spawn_Send(entity to, float sf)
+{
+       WriteByte(MSG_ENTITY, ENT_CLIENT_SPAWNPOINT);
+       WriteByte(MSG_ENTITY, self.team);
+       WriteShort(MSG_ENTITY, self.origin_x);
+       WriteShort(MSG_ENTITY, self.origin_y);
+       WriteShort(MSG_ENTITY, self.origin_z);
+       return TRUE;
+}
+
 void spawnpoint_use()
 {
        if(teamplay)
@@ -63,7 +73,10 @@ void relocate_spawnpoint()
         e.solid = SOLID_TRIGGER;
     }
 
-    //Net_LinkEntity(self, FALSE, 0, ItemSend);
+       //self.think = Spawn_Send_Think;
+       //self.nextthink = time;
+
+    Net_LinkEntity(self, FALSE, 0, Spawn_Send);
 }
 
 void spawnfunc_info_player_survivor (void)