]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/nades/all.qc
Net: register all types
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / nades / all.qc
index 86e6d278b2555741ef4e26ff5720683ae82dfb20..7dfae12ac432b692ce17b2cfe9e1323cf7c1f593 100644 (file)
@@ -1,14 +1,12 @@
 #if defined(CSQC)
-       #include "../../dpdefs/csprogsdefs.qh"
        #include "../../client/defs.qh"
        #include "all.qh"
        #include "../buffs/all.qh"
        #include "../movetypes/movetypes.qh"
        #include "../../client/main.qh"
-       #include "../../csqcmodellib/cl_model.qh"
+       #include "../../lib/csqcmodel/cl_model.qh"
 #elif defined(MENUQC)
 #elif defined(SVQC)
-       #include "../../dpdefs/progsdefs.qh"
     #include "../constants.qh"
     #include "../../server/constants.qh"
        #include "../turrets/sv_turrets.qh"
@@ -17,8 +15,8 @@
 
 #ifdef CSQC
 .float ltime;
-void healer_draw()
-{SELFPARAM();
+void healer_draw(entity this)
+{
        float dt = time - self.move_time;
        self.move_time = time;
        if(dt <= 0)
@@ -51,9 +49,11 @@ void healer_setup(entity e)
 }
 #endif // CSQC
 
-REGISTER_LINKED(Nade_Heal, bool isNew)
+REGISTER_NET_LINKED(Nade_Heal)
 #ifdef CSQC
+NET_HANDLE(Nade_Heal, bool isNew)
 {
+       Net_Accept(Nade_Heal);
        int sf = ReadByte();
        if (sf & 1) {
                this.origin_x = ReadCoord();
@@ -66,25 +66,26 @@ REGISTER_LINKED(Nade_Heal, bool isNew)
                // this.ltime = time + this.healer_lifetime;
                healer_setup(this);
        }
+       return true;
 }
 #endif
 
 #ifdef SVQC
-float healer_send(entity to, int sf)
+bool healer_send(entity this, entity to, int sf)
 {
-       SELFPARAM();
-       WriteByte(MSG_ENTITY, Linked_Nade_Heal.m_id);
-       WriteByte(MSG_ENTITY, sf);
+       int channel = MSG_ENTITY;
+       WriteHeader(channel, Nade_Heal);
+       WriteByte(channel, sf);
        if (sf & 1) {
-               WriteCoord(MSG_ENTITY, this.origin.x);
-               WriteCoord(MSG_ENTITY, this.origin.y);
-               WriteCoord(MSG_ENTITY, this.origin.z);
+               WriteCoord(channel, this.origin.x);
+               WriteCoord(channel, this.origin.y);
+               WriteCoord(channel, this.origin.z);
 
-               WriteByte(MSG_ENTITY, this.healer_lifetime);
+               WriteByte(channel, this.healer_lifetime);
                //WriteByte(MSG_ENTITY, this.ltime - time + 1);
-               WriteShort(MSG_ENTITY, this.healer_radius);
+               WriteShort(channel, this.healer_radius);
                // round time delta to a 1/10th of a second
-               WriteByte(MSG_ENTITY, (this.ltime - time)*10.0+0.5);
+               WriteByte(channel, (this.ltime - time)*10.0+0.5);
        }
        return true;
 }