]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/triggers/trigger/viewloc.qc
Merge branch 'terencehill/menu_languages' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / triggers / trigger / viewloc.qc
index c21fe6b5484b2e935fabe09ebf0d0282bbe9665b..af67533a831fe4622afc39a7b519b369a92917cb 100644 (file)
@@ -5,6 +5,9 @@
     #include "../../../server/defs.qh"
 #endif
 
+REGISTER_NET_LINKED(ENT_CLIENT_VIEWLOC)
+REGISTER_NET_LINKED(ENT_CLIENT_VIEWLOC_TRIGGER)
+
 #ifdef SVQC
 
 void viewloc_think()
@@ -40,7 +43,7 @@ void viewloc_think()
 bool trigger_viewloc_send(entity this, entity to, int sf)
 {
        // CSQC doesn't need to know our origin (yet), as we're only available for referencing
-       WriteByte(MSG_ENTITY, ENT_CLIENT_VIEWLOC_TRIGGER);
+       WriteHeader(MSG_ENTITY, ENT_CLIENT_VIEWLOC_TRIGGER);
 
        WriteEntity(MSG_ENTITY, self.enemy);
        WriteEntity(MSG_ENTITY, self.goalentity);
@@ -90,7 +93,7 @@ spawnfunc(trigger_viewlocation)
 
 bool viewloc_send(entity this, entity to, int sf)
 {
-       WriteByte(MSG_ENTITY, ENT_CLIENT_VIEWLOC);
+       WriteHeader(MSG_ENTITY, ENT_CLIENT_VIEWLOC);
 
        WriteByte(MSG_ENTITY, self.cnt);
 
@@ -137,8 +140,8 @@ void trigger_viewloc_updatelink()
        self.goalentity = findfloat(world, entnum, self.count);
 }
 
-void ent_viewloc_trigger()
-{SELFPARAM();
+NET_HANDLE(ENT_CLIENT_VIEWLOC_TRIGGER, bool isnew)
+{
        float point1 = ReadShort();
        float point2 = ReadShort();
 
@@ -148,6 +151,9 @@ void ent_viewloc_trigger()
        self.origin_x = ReadCoord();
        self.origin_y = ReadCoord();
        self.origin_z = ReadCoord();
+
+       return = true;
+
        setorigin(self, self.origin);
 
        self.cnt = point1;
@@ -160,8 +166,8 @@ void ent_viewloc_trigger()
        self.drawmask = MASK_NORMAL; // not so concerned, but better keep it alive
 }
 
-void ent_viewloc()
-{SELFPARAM();
+NET_HANDLE(ENT_CLIENT_VIEWLOC, bool isnew)
+{
        self.cnt = ReadByte();
 
        self.origin_x = ReadCoord();
@@ -173,6 +179,8 @@ void ent_viewloc()
        self.movedir_y = ReadCoord();
        self.movedir_z = ReadCoord();
 
+       return = true;
+
        self.classname = ((self.cnt == 2) ? "target_viewlocation_end" : "target_viewlocation_start");
        self.drawmask = MASK_NORMAL; // don't cull it
 }