X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fclient%2Fmain.qc;h=5ed049c609619664da47f18d03451e3a9dbbadc6;hp=ca31f32f71bf7b5afb82bb487a650653d1da108d;hb=6b8490ff79ca48220bd0023b5da4019d1bfdcd7d;hpb=5607e279fe7b0dc9f92e15556ed6dc33f17f549c diff --git a/qcsrc/client/main.qc b/qcsrc/client/main.qc index ca31f32f7..5ed049c60 100644 --- a/qcsrc/client/main.qc +++ b/qcsrc/client/main.qc @@ -25,7 +25,7 @@ #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" @@ -146,7 +146,6 @@ 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); @@ -796,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; @@ -821,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); @@ -838,6 +834,13 @@ void CSQC_Ent_Update(float bIsNewEntity) } #endif self.enttype = t; + bool done = false; + FOREACH(Linked, it.m_id == t, LAMBDA( + it.m_read(self, bIsNewEntity); + done = true; + break; + )); + if (!done) switch(t) { case ENT_CLIENT_MUTATOR: { @@ -884,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;