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=3603fab1e1042983929507f6ba6c208702230704;hb=b974a7cdcce185eede9dcf22d2c95772cab31401;hpb=802d673ea15260b02ce6760839cc40a2a57b21b1 diff --git a/qcsrc/client/main.qc b/qcsrc/client/main.qc index 3603fab1e1..e3f07b275c 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.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" @@ -125,7 +123,7 @@ void CSQC_Init(void) registercvar("cl_jumpspeedcap_min", ""); registercvar("cl_jumpspeedcap_max", ""); - registercvar("cl_multijump", "1"); + registercvar("cl_multijump", "0"); registercvar("cl_spawn_near_teammate", "1"); @@ -148,24 +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_model("null"); - 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) { @@ -779,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); } } } @@ -807,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; @@ -832,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); @@ -849,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: { @@ -895,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; @@ -936,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; } @@ -985,7 +976,7 @@ void CSQC_Parse_Print(string strMessage) if(autocvar_developer_csqcentities) LOG_INFOF("CSQC_Parse_Print(\"%s\")\n", strMessage); - LOG_INFO(ColorTranslateRGB(strMessage)); + print(ColorTranslateRGB(strMessage)); } // CSQC_Parse_CenterPrint : Provides the centerprint_hud string in the first parameter that the server provided.