]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/main.qc
Merge branch 'master' into TimePath/vehicles_cleanup
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / main.qc
index 0b75058b43ee5174925980de62065e04a159e9e4..ca3fb3093e85e9396b1c64ac76f57151adab67a3 100644 (file)
@@ -1,20 +1,53 @@
+#include "main.qh"
+#include "_all.qh"
+
+#include "casings.qh"
+#include "csqcmodel_hooks.qh"
+#include "damage.qh"
+#include "effects.qh"
+#include "gibs.qh"
+#include "hook.qh"
+#include "hud.qh"
+#include "hud_config.qh"
+#include "laser.qh"
 #include "mapvoting.qh"
 #include "modeleffects.qh"
 #include "particles.qh"
 #include "mapvoting.qh"
 #include "modeleffects.qh"
 #include "particles.qh"
+#include "prandom.qh"
 #include "scoreboard.qh"
 #include "shownames.qh"
 #include "scoreboard.qh"
 #include "shownames.qh"
+#include "sortlist.qh"
 #include "tturrets.qh"
 #include "tuba.qh"
 #include "tturrets.qh"
 #include "tuba.qh"
+#include "t_items.qh"
 #include "wall.qh"
 #include "waypointsprites.qh"
 
 #include "wall.qh"
 #include "waypointsprites.qh"
 
-#include "vehicles/vehicles.qh"
+#include "../common/vehicles/all.qh"
 
 
-#include "../server/vehicles/bumblebee.qh"
+#include "mutators/events.qh"
 
 
+#include "weapons/projectile.qh"
+
+#include "../common/buffs.qh"
+#include "../common/deathtypes.qh"
+#include "../common/effects.qh"
+#include "../common/mapinfo.qh"
+#include "../common/monsters/all.qh"
+#include "../common/nades.qh"
 #include "../common/net_notice.qh"
 #include "../common/net_notice.qh"
+#include "../common/notifications.qh"
+#include "../common/stats.qh"
+#include "../common/teams.qh"
+
+#include "../common/items/all.qh"
+
+#include "../common/mutators/base.qh"
+
+#include "../common/weapons/all.qh"
 
 
-#include "../common/monsters/monsters.qh"
+#include "../csqcmodellib/cl_model.qh"
+#include "../csqcmodellib/interpolate.qh"
 
 #include "../common/triggers/include.qh"
 
 
 #include "../common/triggers/include.qh"
 
@@ -90,6 +123,9 @@ void CSQC_Init(void)
        registercvar("cl_nade_type", "3");
        registercvar("cl_pokenade_type", "zombie");
 
        registercvar("cl_nade_type", "3");
        registercvar("cl_pokenade_type", "zombie");
 
+       registercvar("cl_jumpspeedcap_min", "");
+       registercvar("cl_jumpspeedcap_max", "");
+
        gametype = 0;
 
        // hud_fields uses strunzone on the titles!
        gametype = 0;
 
        // hud_fields uses strunzone on the titles!
@@ -108,13 +144,11 @@ void CSQC_Init(void)
        GetTeam(NUM_SPECTATOR, true); // add specs first
 
        // needs to be done so early because of the constants they create
        GetTeam(NUM_SPECTATOR, true); // add specs first
 
        // needs to be done so early because of the constants they create
-       CALL_ACCUMULATED_FUNCTION(RegisterWeapons);
-       CALL_ACCUMULATED_FUNCTION(RegisterMonsters);
-       CALL_ACCUMULATED_FUNCTION(RegisterGametypes);
+       static_init();
        CALL_ACCUMULATED_FUNCTION(RegisterNotifications);
        CALL_ACCUMULATED_FUNCTION(RegisterDeathtypes);
        CALL_ACCUMULATED_FUNCTION(RegisterHUD_Panels);
        CALL_ACCUMULATED_FUNCTION(RegisterNotifications);
        CALL_ACCUMULATED_FUNCTION(RegisterDeathtypes);
        CALL_ACCUMULATED_FUNCTION(RegisterHUD_Panels);
-       CALL_ACCUMULATED_FUNCTION(RegisterBuffs);
+       CALL_ACCUMULATED_FUNCTION(RegisterEffects);
 
        WaypointSprite_Load();
 
 
        WaypointSprite_Load();
 
@@ -127,7 +161,6 @@ void CSQC_Init(void)
        Hook_Precache();
        GibSplash_Precache();
        Casings_Precache();
        Hook_Precache();
        GibSplash_Precache();
        Casings_Precache();
-       Vehicles_Precache();
        turrets_precache();
        Tuba_Precache();
        CSQCPlayer_Precache();
        turrets_precache();
        Tuba_Precache();
        CSQCPlayer_Precache();
@@ -159,8 +192,6 @@ void CSQC_Init(void)
        WarpZone_Init();
 
        hud_skin_path = strzone(strcat("gfx/hud/", autocvar_hud_skin));
        WarpZone_Init();
 
        hud_skin_path = strzone(strcat("gfx/hud/", autocvar_hud_skin));
-       hud_configure_prev = -1;
-
        draw_currentSkin = strzone(strcat("gfx/menu/", cvar_string("menu_skin")));
 }
 
        draw_currentSkin = strzone(strcat("gfx/menu/", cvar_string("menu_skin")));
 }
 
@@ -669,7 +700,7 @@ void Ent_ReadSpawnPoint(float is_new) // entity for spawnpoint
        if(is_new)
        {
                self.origin = spn_origin;
        if(is_new)
        {
                self.origin = spn_origin;
-               setsize(self, PL_MIN, PL_MAX);
+               setsize(self, PL_MIN_CONST, PL_MAX_CONST);
                droptofloor();
 
                /*if(autocvar_cl_spawn_point_model) // needs a model first
                droptofloor();
 
                /*if(autocvar_cl_spawn_point_model) // needs a model first
@@ -833,6 +864,7 @@ void CSQC_Ent_Update(float bIsNewEntity)
                case ENT_CLIENT_WARPZONE_TELEPORTED: WarpZone_Teleported_Read(bIsNewEntity); break;
                case ENT_CLIENT_TRIGGER_MUSIC: Ent_ReadTriggerMusic(); break;
                case ENT_CLIENT_HOOK: Ent_ReadHook(bIsNewEntity, ENT_CLIENT_HOOK); break;
                case ENT_CLIENT_WARPZONE_TELEPORTED: WarpZone_Teleported_Read(bIsNewEntity); break;
                case ENT_CLIENT_TRIGGER_MUSIC: Ent_ReadTriggerMusic(); break;
                case ENT_CLIENT_HOOK: Ent_ReadHook(bIsNewEntity, ENT_CLIENT_HOOK); break;
+               case ENT_CLIENT_INVENTORY: Inventory_Read(self); break;
                case ENT_CLIENT_ARC_BEAM: Ent_ReadArcBeam(bIsNewEntity); break;
                case ENT_CLIENT_ACCURACY: Ent_ReadAccuracy(); break;
                case ENT_CLIENT_AUXILIARYXHAIR: Net_AuXair2(bIsNewEntity); break;
                case ENT_CLIENT_ARC_BEAM: Ent_ReadArcBeam(bIsNewEntity); break;
                case ENT_CLIENT_ACCURACY: Ent_ReadAccuracy(); break;
                case ENT_CLIENT_AUXILIARYXHAIR: Net_AuXair2(bIsNewEntity); break;
@@ -844,6 +876,8 @@ void CSQC_Ent_Update(float bIsNewEntity)
                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_SPAWNEVENT: Ent_ReadSpawnEvent(bIsNewEntity); break;
                case ENT_CLIENT_NOTIFICATION: Read_Notification(bIsNewEntity); break;
                case ENT_CLIENT_HEALING_ORB: ent_healer(); break;
+               case ENT_CLIENT_VIEWLOC: ent_viewloc(); break;
+               case ENT_CLIENT_VIEWLOC_TRIGGER: ent_viewloc_trigger(); break;
                case ENT_CLIENT_LADDER: ent_func_ladder(); break;
                case ENT_CLIENT_TRIGGER_PUSH: ent_trigger_push(); break;
                case ENT_CLIENT_TARGET_PUSH: ent_target_push(); break;
                case ENT_CLIENT_LADDER: ent_func_ladder(); break;
                case ENT_CLIENT_TRIGGER_PUSH: ent_trigger_push(); break;
                case ENT_CLIENT_TARGET_PUSH: ent_target_push(); break;
@@ -854,6 +888,8 @@ void CSQC_Ent_Update(float bIsNewEntity)
                case ENT_CLIENT_CORNER: ent_corner(); break;
                case ENT_CLIENT_KEYLOCK: ent_keylock(); break;
                case ENT_CLIENT_TRAIN: ent_train(); break;
                case ENT_CLIENT_CORNER: ent_corner(); break;
                case ENT_CLIENT_KEYLOCK: ent_keylock(); break;
                case ENT_CLIENT_TRAIN: ent_train(); break;
+               case ENT_CLIENT_TRIGGER_IMPULSE: ent_trigger_impulse(); break;
+               case ENT_CLIENT_EFFECT: Read_Effect(bIsNewEntity); break;
 
                default:
                        //error(strcat(_("unknown entity type in CSQC_Ent_Update: %d\n"), self.enttype));
 
                default:
                        //error(strcat(_("unknown entity type in CSQC_Ent_Update: %d\n"), self.enttype));
@@ -1220,69 +1256,55 @@ void Net_WeaponComplain()
 // 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()
 {
 // 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()
 {
-       float bHandled;
-               bHandled  = true;
        // Acquire TE ID
        // Acquire TE ID
-       float nTEID;
-               nTEID = ReadByte();
+       int nTEID = ReadByte();
 
 
-       if(autocvar_developer_csqcentities)
+       if (autocvar_developer_csqcentities)
                printf("CSQC_Parse_TempEntity() with nTEID=%d\n", nTEID);
 
                printf("CSQC_Parse_TempEntity() with nTEID=%d\n", nTEID);
 
-               // NOTE: Could just do return instead of break...
-       switch(nTEID)
+       switch (nTEID)
        {
        {
+               case TE_CSQC_MUTATOR:
+                       int mutID = ReadMutator();
+                       if (MUTATOR_CALLHOOK(CSQC_Parse_TempEntity, mutID))
+                       return true;
                case TE_CSQC_TARGET_MUSIC:
                        Net_TargetMusic();
                case TE_CSQC_TARGET_MUSIC:
                        Net_TargetMusic();
-                       bHandled = true;
-                       break;
+                       return true;
                case TE_CSQC_PICTURE:
                        Net_MapVote_Picture();
                case TE_CSQC_PICTURE:
                        Net_MapVote_Picture();
-                       bHandled = true;
-                       break;
+                       return true;
                case TE_CSQC_RACE:
                        Net_ReadRace();
                case TE_CSQC_RACE:
                        Net_ReadRace();
-                       bHandled = true;
-                       break;
+                       return true;
                case TE_CSQC_VORTEXBEAMPARTICLE:
                        Net_ReadVortexBeamParticle();
                case TE_CSQC_VORTEXBEAMPARTICLE:
                        Net_ReadVortexBeamParticle();
-                       bHandled = true;
-                       break;
+                       return true;
                case TE_CSQC_TEAMNAGGER:
                        Net_TeamNagger();
                case TE_CSQC_TEAMNAGGER:
                        Net_TeamNagger();
-                       bHandled = true;
-                       break;
+                       return true;
                case TE_CSQC_ARC:
                        Net_ReadArc();
                case TE_CSQC_ARC:
                        Net_ReadArc();
-                       bHandled = true;
-                       break;
+                       return true;
                case TE_CSQC_PINGPLREPORT:
                        Net_ReadPingPLReport();
                case TE_CSQC_PINGPLREPORT:
                        Net_ReadPingPLReport();
-                       bHandled = true;
-                       break;
+                       return true;
                case TE_CSQC_WEAPONCOMPLAIN:
                        Net_WeaponComplain();
                case TE_CSQC_WEAPONCOMPLAIN:
                        Net_WeaponComplain();
-                       bHandled = true;
-                       break;
+                       return true;
                case TE_CSQC_VEHICLESETUP:
                        Net_VehicleSetup();
                case TE_CSQC_VEHICLESETUP:
                        Net_VehicleSetup();
-                       bHandled = true;
-                       break;
+                       return true;
                case TE_CSQC_SVNOTICE:
                        cl_notice_read();
                case TE_CSQC_SVNOTICE:
                        cl_notice_read();
-                       bHandled = true;
-                       break;
+                       return true;
                case TE_CSQC_SHOCKWAVEPARTICLE:
                        Net_ReadShockwaveParticle();
                case TE_CSQC_SHOCKWAVEPARTICLE:
                        Net_ReadShockwaveParticle();
-                       bHandled = true;
-                       break;
+                       return true;
                default:
                        // No special logic for this temporary entity; return 0 so the engine can handle it
                default:
                        // No special logic for this temporary entity; return 0 so the engine can handle it
-                       bHandled = false;
-                       break;
+                       return false;
        }
        }
-
-       return bHandled;
 }
 
 string getcommandkey(string text, string command)
 }
 
 string getcommandkey(string text, string command)