]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/lib/net.qh
Remove the CSQC model hook macros (we use a parameter in them now that may cause...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / lib / net.qh
index 2473d672c24d87b746dc15a0aaa0faeade8b1ec9..b0320eadb13f3e006fa72f0f301378dfac24ffb9 100644 (file)
@@ -1,5 +1,4 @@
-#ifndef NET_H
-#define NET_H
+#pragma once
 
 #include "registry.qh"
 #include "sort.qh"
@@ -43,8 +42,7 @@ STATIC_INIT(RegisterTempEntities_renumber) { FOREACH(TempEntities, true, it.m_id
                [[accumulate]] NET_HANDLE(id, bool isnew) \
                { \
                        this = self; \
-                       this.sourceLocFile = __FILE__; \
-                       this.sourceLocLine = __LINE__; \
+                       this.sourceLoc = __FILE__ ":" STR(__LINE__); \
                        if (!this) isnew = true; \
                } \
                REGISTER(LinkedEntities, NET, id, m_id, new_pure(net_linked_packet)) \
@@ -109,7 +107,7 @@ STATIC_INIT(C2S_Protocol_renumber) { FOREACH(C2S_Protocol, true, it.m_id = i); }
        {
                if (e.classname == "") e.classname = "net_linked";
 
-               if (e.model == "" || self.modelindex == 0)
+               if (e.model == "" || e.modelindex == 0)
                {
                        vector mi = e.mins;
                        vector ma = e.maxs;
@@ -346,8 +344,9 @@ STATIC_INIT(C2S_Protocol_renumber) { FOREACH(C2S_Protocol, true, it.m_id = i); }
                }
 
                // allow writing to also pass through to spectators (like so spectators see the same centerprints as players for example)
-               #define WRITESPECTATABLE_MSG_ONE(statement) MACRO_BEGIN { \
-                       entity dst = msg_entity; \
+               #define WRITESPECTATABLE_MSG_ONE(to, statement) MACRO_BEGIN { \
+                       entity prev = msg_entity; \
+                       entity dst = to; \
                        FOREACH_CLIENT(IS_REAL_CLIENT(it), { \
                                if (it == dst || (it.classname == STR_SPECTATOR && it.enemy == dst)) \
                                { \
@@ -355,9 +354,7 @@ STATIC_INIT(C2S_Protocol_renumber) { FOREACH(C2S_Protocol, true, it.m_id = i); }
                                        LAMBDA(statement); \
                                } \
                        }); \
-                       msg_entity = dst; \
+                       msg_entity = prev; \
                } MACRO_END
        #endif
 #endif
-
-#endif