From 1a75c956aa9ff23141cea046c8e154336d5d816b Mon Sep 17 00:00:00 2001 From: Samual Lenks Date: Fri, 8 Feb 2013 00:41:29 -0500 Subject: [PATCH] Network spawn points to client and crudely (for now) do an effect for them --- qcsrc/client/Main.qc | 28 +++++++++++++++++++++++++++- qcsrc/common/constants.qh | 2 +- qcsrc/server/spawnpoints.qc | 15 ++++++++++++++- 3 files changed, 42 insertions(+), 3 deletions(-) diff --git a/qcsrc/client/Main.qc b/qcsrc/client/Main.qc index 3d8225442..163301b95 100644 --- a/qcsrc/client/Main.qc +++ b/qcsrc/client/Main.qc @@ -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)); diff --git a/qcsrc/common/constants.qh b/qcsrc/common/constants.qh index bc4b7bda1..44c8c1442 100644 --- a/qcsrc/common/constants.qh +++ b/qcsrc/common/constants.qh @@ -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; diff --git a/qcsrc/server/spawnpoints.qc b/qcsrc/server/spawnpoints.qc index 197eb30bf..c0846b742 100644 --- a/qcsrc/server/spawnpoints.qc +++ b/qcsrc/server/spawnpoints.qc @@ -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) -- 2.39.2