]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/lib/net.qh
Unsafe: allow field casting
[xonotic/xonotic-data.pk3dir.git] / qcsrc / lib / net.qh
index f0a9cc282dc4d24d28a7abb3d8b9097af3f0a982..4e09d4b01043363a619153154f90dd08baf5ba6d 100644 (file)
@@ -97,11 +97,6 @@ STATIC_INIT(C2S_Protocol_renumber) { FOREACH(C2S_Protocol, true, it.m_id = i); }
 
        .int Version;  // deprecated, use SendFlags
        .int SendFlags;
-       .bool(entity to, int sendflags) SendEntity;
-       /** return false to remove from the client */
-       .bool(entity this, entity to, int sendflags) SendEntity3;
-
-       bool SendEntity_self(entity to, int sendflags) { SELFPARAM(); return this.SendEntity3(this, to, sendflags); }
 
        void Net_LinkEntity(entity e, bool docull, float dt, bool(entity this, entity to, int sendflags) sendfunc)
        {
@@ -115,8 +110,7 @@ STATIC_INIT(C2S_Protocol_renumber) { FOREACH(C2S_Protocol, true, it.m_id = i); }
                        setsize(e, mi, ma);
                }
 
-               e.SendEntity = SendEntity_self;
-               e.SendEntity3 = sendfunc;
+               setSendEntity(e, sendfunc);
                e.SendFlags = 0xFFFFFF;
 
                if (!docull) e.effects |= EF_NODEPTHTEST;
@@ -130,22 +124,22 @@ STATIC_INIT(C2S_Protocol_renumber) { FOREACH(C2S_Protocol, true, it.m_id = i); }
 
        void Net_UnlinkEntity(entity e)
        {
-               e.SendEntity = func_null;
+               setSendEntity(e, func_null);
        }
 
-       .void() uncustomizeentityforclient;
+       .void(entity this) uncustomizeentityforclient;
        .float uncustomizeentityforclient_set;
 
-       void SetCustomizer(entity e, float() customizer, void() uncustomizer)
+       void SetCustomizer(entity e, bool(entity this) customizer, void(entity this) uncustomizer)
        {
-               e.customizeentityforclient = customizer;
+               setcefc(e, customizer);
                e.uncustomizeentityforclient = uncustomizer;
                e.uncustomizeentityforclient_set = !!uncustomizer;
        }
 
        void UncustomizeEntitiesRun()
        {
-               FOREACH_ENTITY_FLOAT(uncustomizeentityforclient_set, true, WITHSELF(it, it.uncustomizeentityforclient()));
+               FOREACH_ENTITY_FLOAT(uncustomizeentityforclient_set, true, it.uncustomizeentityforclient(it));
        }
 
        STRING_ITERATOR(g_buf, string_null, 0);