]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/lib/net.qh
Merge branch 'marin-t/nadectr' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / lib / net.qh
index 86c15ec473e1bcdee8ad4a29891b5f8462ea9194..0a3dd8c662a8ac8e1f91e26ab820b8cbe658f842 100644 (file)
@@ -98,6 +98,9 @@ STATIC_INIT(C2S_Protocol_renumber) { FOREACH(C2S_Protocol, true, it.m_id = i); }
        .int Version;  // deprecated, use SendFlags
        .int SendFlags;
 
+       IntrusiveList g_uncustomizables;
+       STATIC_INIT(g_uncustomizables) { g_uncustomizables = IL_NEW(); }
+
        void Net_LinkEntity(entity e, bool docull, float dt, bool(entity this, entity to, int sendflags) sendfunc)
        {
                if (e.classname == "") e.classname = "net_linked";
@@ -135,11 +138,13 @@ STATIC_INIT(C2S_Protocol_renumber) { FOREACH(C2S_Protocol, true, it.m_id = i); }
                setcefc(e, customizer);
                e.uncustomizeentityforclient = uncustomizer;
                e.uncustomizeentityforclient_set = !!uncustomizer;
+               if(uncustomizer)
+                       IL_PUSH(g_uncustomizables, e);
        }
 
        void UncustomizeEntitiesRun()
        {
-               FOREACH_ENTITY_FLOAT(uncustomizeentityforclient_set, true, it.uncustomizeentityforclient(it));
+               IL_EACH(g_uncustomizables, it.uncustomizeentityforclient_set, it.uncustomizeentityforclient(it));
        }
 
        STRING_ITERATOR(g_buf, string_null, 0);
@@ -293,6 +298,7 @@ USING(Stream, int);
        #define APPROXPASTTIME_RANGE (64 * APPROXPASTTIME_ACCURACY_REQUIREMENT)
 
        #ifdef CSQC
+               float servertime;
                entity ReadCSQCEntity()
                {
                        int f = ReadShort();
@@ -305,14 +311,14 @@ USING(Stream, int);
                        v += ReadByte();          // note: this is unsigned
                        return v;
                }
-               #define ReadInt48_t() vec3(ReadInt24_t(), ReadInt24_t(), 0)
+               #define ReadInt48_t() vec2(ReadInt24_t(), ReadInt24_t())
                #define ReadInt72_t() vec3(ReadInt24_t(), ReadInt24_t(), ReadInt24_t())
 
-               int _ReadSByte;
+               noref int _ReadSByte;
                #define ReadSByte() (_ReadSByte = ReadByte(), (_ReadSByte & BIT(7) ? -128 : 0) + (_ReadSByte & BITS(7)))
                #define ReadFloat() ReadCoord()
                #define ReadVector() vec3(ReadFloat(), ReadFloat(), ReadFloat())
-               #define ReadVector2D() vec3(ReadFloat(), ReadFloat(), 0)
+               #define ReadVector2D() vec2(ReadFloat(), ReadFloat())
 
                float ReadApproxPastTime()
                {