X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fclient%2Fmain.qc;h=e3f07b275c969a6dea7c9d6ff966f985d55f082c;hp=c534cc7a5db46dc3362a9b511b551e7bb4861f86;hb=b974a7cdcce185eede9dcf22d2c95772cab31401;hpb=fa9b4da73e5a48423237dfc709700fc0a206f024;ds=sidebyside diff --git a/qcsrc/client/main.qc b/qcsrc/client/main.qc index c534cc7a5..e3f07b275 100644 --- a/qcsrc/client/main.qc +++ b/qcsrc/client/main.qc @@ -2,7 +2,6 @@ #include "_all.qh" #include "controlpoint.qh" -#include "csqcmodel_hooks.qh" #include "damage.qh" #include "effects.qh" #include "generator.qh" @@ -26,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" @@ -49,7 +48,6 @@ #include "../common/triggers/include.qh" #include "../common/turrets/cl_turrets.qh" -#include "../common/turrets/turrets.qh" #include "../warpzonelib/client.qh" @@ -148,23 +146,14 @@ 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 - precache_sound("misc/hit.wav"); - precache_sound("misc/typehit.wav"); - generator_precache(); Projectile_Precache(); - Hook_Precache(); - GibSplash_Precache(); Tuba_Precache(); - CSQCPlayer_Precache(); if(autocvar_cl_reticle) { @@ -778,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); } } } @@ -806,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; @@ -831,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); @@ -848,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: { @@ -894,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; @@ -935,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; }