X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fclient%2Fmain.qc;h=d494050f060b025bb8fc6838ba16a0bf3d98096a;hp=5dec3202fc89d902b72ea4e132de753c14eb2242;hb=784ed7e054583264723e7638b3f6817a87cf3de7;hpb=829a812da653d84460edd31a9651bde65d3bb269 diff --git a/qcsrc/client/main.qc b/qcsrc/client/main.qc index 5dec3202f..d494050f0 100644 --- a/qcsrc/client/main.qc +++ b/qcsrc/client/main.qc @@ -25,12 +25,12 @@ #include "weapons/projectile.qh" -#include "../common/buffs.qh" +#include "../common/buffs/all.qh" #include "../common/deathtypes.qh" #include "../common/effects/effects.qh" #include "../common/mapinfo.qh" #include "../common/monsters/all.qh" -#include "../common/nades.qh" +#include "../common/nades/all.qh" #include "../common/net_notice.qh" #include "../common/notifications.qh" #include "../common/stats.qh" @@ -146,13 +146,10 @@ void CSQC_Init(void) // needs to be done so early because of the constants they create static_init(); - CALL_ACCUMULATED_FUNCTION(RegisterTurrets); CALL_ACCUMULATED_FUNCTION(RegisterNotifications); CALL_ACCUMULATED_FUNCTION(RegisterDeathtypes); CALL_ACCUMULATED_FUNCTION(RegisterHUD_Panels); - initialize_minigames(); - // precaches Projectile_Precache(); @@ -798,15 +795,13 @@ void Ent_Init(); void Ent_ScoresInfo(); void CSQC_Ent_Update(float bIsNewEntity) {SELFPARAM(); - float t; - float savetime; - t = ReadByte(); + int t = ReadByte(); if(autocvar_developer_csqcentities) LOG_INFOF("CSQC_Ent_Update(%d) with self=%i self.entnum=%d self.enttype=%d t=%d\n", bIsNewEntity, self, self.entnum, self.enttype, t); // set up the "time" global for received entities to be correct for interpolation purposes - savetime = time; + float savetime = time; if(servertime) { time = servertime; @@ -823,7 +818,6 @@ void CSQC_Ent_Update(float bIsNewEntity) { if(t != self.enttype || bIsNewEntity) { - //print("A CSQC entity changed its type!\n"); LOG_INFOF("A CSQC entity changed its type! (edict: %d, server: %d, type: %d -> %d)\n", num_for_edict(self), self.entnum, self.enttype, t); Ent_Remove(); clearentity(self); @@ -840,6 +834,13 @@ void CSQC_Ent_Update(float bIsNewEntity) } #endif self.enttype = t; + bool done = false; + FOREACH(LinkedEntities, it.m_id == t, LAMBDA( + it.m_read(self, bIsNewEntity); + done = true; + break; + )); + if (!done) switch(t) { case ENT_CLIENT_MUTATOR: { @@ -886,7 +887,6 @@ void CSQC_Ent_Update(float bIsNewEntity) case ENT_CLIENT_SPAWNPOINT: Ent_ReadSpawnPoint(bIsNewEntity); break; case ENT_CLIENT_SPAWNEVENT: Ent_ReadSpawnEvent(bIsNewEntity); break; case ENT_CLIENT_NOTIFICATION: Read_Notification(bIsNewEntity); break; - case ENT_CLIENT_HEALING_ORB: ent_healer(); break; case ENT_CLIENT_MINIGAME: ent_read_minigame(); break; case ENT_CLIENT_VIEWLOC: ent_viewloc(); break; case ENT_CLIENT_VIEWLOC_TRIGGER: ent_viewloc_trigger(); break; @@ -1266,7 +1266,7 @@ void Net_WeaponComplain() // CSQC_Parse_TempEntity : Handles all temporary entity network data in the CSQC layer. // You must ALWAYS first acquire the temporary ID, which is sent as a byte. // Return value should be 1 if CSQC handled the temporary entity, otherwise return 0 to have the engine process the event. -float CSQC_Parse_TempEntity() +bool CSQC_Parse_TempEntity() { // Acquire TE ID int nTEID = ReadByte(); @@ -1274,6 +1274,10 @@ float CSQC_Parse_TempEntity() if (autocvar_developer_csqcentities) LOG_INFOF("CSQC_Parse_TempEntity() with nTEID=%d\n", nTEID); + FOREACH(TempEntities, it.m_id == nTEID, LAMBDA( + it.m_read(NULL, true); + return true; + )); switch (nTEID) { case TE_CSQC_MUTATOR: