]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'Mario/rain_fix' into 'master'
authorMario <mario.mario@y7mail.com>
Mon, 20 Jan 2020 19:09:39 +0000 (19:09 +0000)
committerMario <mario.mario@y7mail.com>
Mon, 20 Jan 2020 19:09:39 +0000 (19:09 +0000)
Merge branch Mario/rain_fix (M merge request)

See merge request xonotic/xonotic-data.pk3dir!762

qcsrc/common/items/item/pickup.qh
qcsrc/common/physics/movetypes/movetypes.qc
qcsrc/common/t_items.qc
qcsrc/common/weapons/weapon/porto.qc
qcsrc/common/weapons/weapon/shotgun.qc
qcsrc/ecs/lib.qh
qcsrc/lib/csqcmodel/cl_player.qc
qcsrc/server/defs.qh
qcsrc/server/g_world.qc

index 0f09901af214c9c24bd78023b163b365400bd8d2..7e31994075c244277201a4d02799825c89346f44 100644 (file)
@@ -34,7 +34,7 @@ CLASS(Pickup, GameItem)
     ATTRIB(Pickup, m_itemid, int, 0);
 #ifdef SVQC
     ATTRIB(Pickup, m_mins, vector, '-16 -16 0');
-    ATTRIB(Pickup, m_maxs, vector, '16 16 32');
+    ATTRIB(Pickup, m_maxs, vector, '16 16 48');
     ATTRIB(Pickup, m_botvalue, int, 0);
     ATTRIB(Pickup, m_itemflags, int, 0);
     float generic_pickupevalfunc(entity player, entity item);
index 9d32cf3d5bb8347fd40c2eecdadf33d23f5b4429..68d4c366016f922f0374e54a69a8b34ac1c9dfdd 100644 (file)
@@ -7,6 +7,8 @@ void set_movetype(entity this, int mt)
        if (mt == MOVETYPE_PHYSICS || mt == MOVETYPE_PUSH || mt == MOVETYPE_FAKEPUSH) {
                this.move_qcphysics = false;
        }
+       if(!IL_CONTAINS(g_moveables, this))
+               IL_PUSH(g_moveables, this); // add it to the moveable entities list (even if it doesn't move!) logic: if an object never sets its movetype, we assume it never does anything notable
        this.movetype = (this.move_qcphysics) ? MOVETYPE_NONE : mt;
 }
 #elif defined(CSQC)
index 1029f7865682df59cdde8d83500552bd0503a8b7..df3bb9b521d3ae4a43046513e330fa0cfc138de4 100644 (file)
@@ -174,8 +174,7 @@ NET_HANDLE(ENT_CLIENT_ITEM, bool isnew)
 
     if(sf & ISF_SIZE)
     {
-        float use_bigsize = ReadByte();
-        setsize(this, '-16 -16 0', (use_bigsize) ? '16 16 48' : '16 16 32');
+        setsize(this, '-16 -16 0', '16 16 48');
     }
 
     if(sf & ISF_STATUS) // need to read/write status first so model can handle simple, fb etc.
@@ -205,8 +204,6 @@ NET_HANDLE(ENT_CLIENT_ITEM, bool isnew)
         this.solid = SOLID_TRIGGER;
         //this.flags |= FL_ITEM;
 
-        bool use_bigsize = ReadByte();
-
         this.fade_end = ReadShort();
         this.fade_start = ReadShort();
         if(!warpzone_warpzones_exist && this.fade_start && !autocvar_cl_items_nofade)
@@ -257,7 +254,7 @@ NET_HANDLE(ENT_CLIENT_ITEM, bool isnew)
         precache_model(this.mdl);
         _setmodel(this, this.mdl);
 
-        setsize(this, '-16 -16 0', (use_bigsize) ? '16 16 48' : '16 16 32');
+        setsize(this, '-16 -16 0', '16 16 48');
     }
 
     if(sf & ISF_COLORMAP)
@@ -326,19 +323,14 @@ bool ItemSend(entity this, entity to, int sf)
                WriteAngle(MSG_ENTITY, this.angles_z);
        }
 
-       if(sf & ISF_SIZE)
-       {
-               Pickup p = this.itemdef;
-               WriteByte(MSG_ENTITY, p.instanceOfPowerup || p.instanceOfHealth || p.instanceOfArmor);
-       }
+       // sets size on the client, unused on server
+       //if(sf & ISF_SIZE)
 
        if(sf & ISF_STATUS)
                WriteByte(MSG_ENTITY, this.ItemStatus);
 
        if(sf & ISF_MODEL)
        {
-               Pickup p = this.itemdef;
-               WriteByte(MSG_ENTITY, p.instanceOfPowerup || p.instanceOfHealth || p.instanceOfArmor);
                WriteShort(MSG_ENTITY, this.fade_end);
                WriteShort(MSG_ENTITY, this.fade_start);
 
index 44b73fb05ab3a3db2d121ee585abe14700902c3b..fd33dacded56547632bda86e12359ae6187df06f 100644 (file)
@@ -118,7 +118,7 @@ void W_Porto_Fail(entity this, float failhard)
 
        if(this.cnt < 0 && !failhard && this.realowner.playerid == this.playerid && !IS_DEAD(this.realowner) && !(STAT(WEAPONS, this.realowner) & WEPSET(PORTO)))
        {
-               setsize(this, '-16 -16 0', '16 16 32');
+               setsize(this, '-16 -16 0', '16 16 48');
                setorigin(this, this.origin + trace_plane_normal);
                if(move_out_of_solid(this))
                {
index e2f4b640aa1b818f3a6b7640c9cf7be2d61c93b2..b8cae5fd5da0d66c0216c9806c788b1752cfab8d 100644 (file)
@@ -2,6 +2,9 @@
 
 #ifdef SVQC
 
+// enable to debug melee range
+//#define SHOTGUN_MELEEDEBUG
+
 METHOD(Shotgun, m_spawnfunc_hookreplace, Weapon(Shotgun this, entity e))
 {
        if (autocvar_sv_q3acompat_machineshotgunswap && !Item_IsLoot(e))
@@ -89,8 +92,10 @@ void W_Shotgun_Melee_Think(entity this)
                WarpZone_traceline_antilag(this.realowner, this.realowner.origin + this.realowner.view_ofs, targpos, false, this.realowner, ((IS_CLIENT(this.realowner)) ? ANTILAG_LATENCY(this.realowner) : 0));
 
                // draw lightning beams for debugging
-               //te_lightning2(NULL, targpos, this.realowner.origin + this.realowner.view_ofs + v_forward * 5 - v_up * 5);
-               //te_customflash(targpos, 40,  2, '1 1 1');
+       #ifdef SHOTGUN_MELEEDEBUG
+               te_lightning2(NULL, targpos, this.realowner.origin + this.realowner.view_ofs + v_forward * 5 - v_up * 5);
+               te_customflash(targpos, 40,  2, '1 1 1');
+       #endif
 
                is_player = (IS_PLAYER(trace_ent) || trace_ent.classname == "body" || IS_MONSTER(trace_ent));
 
@@ -116,7 +121,9 @@ void W_Shotgun_Melee_Think(entity this)
                        if(accuracy_isgooddamage(this.realowner, target_victim)) { accuracy_add(this.realowner, WEP_SHOTGUN, 0, swing_damage); }
 
                        // draw large red flash for debugging
-                       //te_customflash(targpos, 200, 2, '15 0 0');
+               #ifdef SHOTGUN_MELEEDEBUG
+                       te_customflash(targpos, 200, 2, '15 0 0');
+               #endif
 
                        if(WEP_CVAR_SEC(shotgun, melee_multihit)) // allow multiple hits with one swing, but not against the same player twice.
                        {
index 2d48e577b8da2bf72b5ae3fa8cf19da46d8b89aa..192136b6253225e014490f4d4e100f2ddfca30e9 100644 (file)
@@ -1,24 +1,29 @@
 #pragma once
 
+IntrusiveList g_events;
+IntrusiveList g_components;
+STATIC_INIT(components) { g_events = IL_NEW(); g_components = IL_NEW(); }
+
 /** Components always interpolate from the previous state */
 #define COMPONENT(com) \
        void com_##com##_interpolate(entity it, float a); \
        .bool com_##com
 
-#define FOREACH_COMPONENT(com, body) FOREACH_ENTITY_FLOAT(com_##com, true, body)
+#define FOREACH_COMPONENT(com, body) IL_EACH(g_components, it.com_##com, body)
 
 
 #define EVENT(T, args) .bool evt_##T##_listener; .void args evt_##T
 
 #define emit(T, ...) \
        MACRO_BEGIN \
-       FOREACH_ENTITY_FLOAT_ORDERED(evt_##T##_listener, true, it.evt_##T(__VA_ARGS__)); \
+       IL_EACH(g_events, it.evt_##T##_listener, it.evt_##T(__VA_ARGS__)); \
        MACRO_END
 
 #define subscribe(listener, T, fn) \
        MACRO_BEGIN \
        listener.evt_##T = (fn); \
        listener.evt_##T##_listener = true; \
+       IL_PUSH(g_events, listener); \
        MACRO_END
 
 
index a7937c317f84e0f2fb7392789429dab06c2e70c5..04a3c2b74072e5391a198224b5a33a7658672e99 100644 (file)
@@ -502,7 +502,7 @@ void CSQCPlayer_CalcRefdef(entity this)
        setproperty(VF_ANGLES, view_angles);
 }
 
-bool autocvar_cl_useenginerefdef = true;
+bool autocvar_cl_useenginerefdef = false;
 
 /** Called once per CSQC_UpdateView() */
 void CSQCPlayer_SetCamera()
index b1d73f6a3124c87110d254d1f2bc73f739003d38..29621f61d83ff80fc73163281d1a9bd0c33da6f8 100644 (file)
@@ -412,6 +412,7 @@ IntrusiveList g_locations;
 IntrusiveList g_saved_team;
 IntrusiveList g_monster_targets;
 IntrusiveList g_pathlib_nodes;
+IntrusiveList g_moveables;
 STATIC_INIT(defs)
 {
        g_monsters = IL_NEW();
@@ -433,4 +434,5 @@ STATIC_INIT(defs)
        g_saved_team = IL_NEW();
        g_monster_targets = IL_NEW();
        g_pathlib_nodes = IL_NEW();
+       g_moveables = IL_NEW();
 }
index c3dc5be39f605369ca208c79ec61490d9bdda3cd..82e67a4067e84f53a522fe8d3c9a5834f2d2bc3e 100644 (file)
@@ -2108,7 +2108,7 @@ void Physics_Frame()
        if(autocvar_sv_freezenonclients)
                return;
 
-       FOREACH_ENTITY_FLOAT(pure_data, false,
+       IL_EACH(g_moveables, true,
        {
                if(IS_CLIENT(it) || it.classname == "" || it.move_movetype == MOVETYPE_PUSH || it.move_movetype == MOVETYPE_FAKEPUSH || it.move_movetype == MOVETYPE_PHYSICS)
                        continue;
@@ -2134,7 +2134,7 @@ void Physics_Frame()
        if(autocvar_sv_gameplayfix_delayprojectiles >= 0)
                return;
 
-       FOREACH_ENTITY_FLOAT(move_qcphysics, true,
+       IL_EACH(g_moveables, it.move_qcphysics,
        {
                if(IS_CLIENT(it) || is_pure(it) || it.classname == "" || it.move_movetype == MOVETYPE_NONE)
                        continue;