X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fclient%2Fmain.qc;h=8ba551d9c3c2011c00a551a06fbb1211869d028f;hp=0f4cd950d00ca3c56d25e2cc674604c9f3bea36f;hb=7bd8f8562a392fda3ac881b1fbe2a35a5ef0f5c8;hpb=3b8a6707fbceb9f57b5d3ab5321e36033da6059d diff --git a/qcsrc/client/main.qc b/qcsrc/client/main.qc index 0f4cd950d0..8ba551d9c3 100644 --- a/qcsrc/client/main.qc +++ b/qcsrc/client/main.qc @@ -48,7 +48,6 @@ #include "../common/triggers/include.qh" #include "../common/turrets/cl_turrets.qh" -#include "../common/turrets/turrets.qh" #include "../warpzonelib/client.qh" @@ -147,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(); @@ -771,7 +767,7 @@ void Ent_ReadSpawnEvent(float is_new) } if(autocvar_cl_spawn_event_sound) { - sound(self, CH_TRIGGER, "misc/spawn.wav", VOL_BASE, ATTEN_NORM); + sound(self, CH_TRIGGER, SND_SPAWN, VOL_BASE, ATTEN_NORM); } } } @@ -799,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; @@ -824,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); @@ -841,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: { @@ -887,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; @@ -928,7 +927,7 @@ void Ent_Remove() if(self.snd_looping > 0) { - sound(self, self.snd_looping, "misc/null.wav", VOL_BASE, autocvar_g_jetpack_attenuation); + sound(self, self.snd_looping, SND_Null, VOL_BASE, autocvar_g_jetpack_attenuation); self.snd_looping = 0; }