]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/ent_cs.qc
Merge branch 'master' into samual/weapons
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / ent_cs.qc
index e1b0efb67324212eeac280f5795731d1ab2202a5..7b3af04bfd9aa9f988f72f7e9a53b28d4ad2a96c 100644 (file)
 void entcs_init()
 {
        print("Initializing ClientSide information entities\n");
-};
+}
 
 float entcs_customize()
 {
        entity o;
        o = self.owner;
-       //if(o.deadflag != DEAD_NO) // allow sending entcs for dead players, for damage effects to work. To be decided!
-       //      return FALSE;
-       if(o.classname != "player")
+       if(o.deadflag != DEAD_NO)
+               return FALSE;
+       if (!IS_PLAYER(o))
                return FALSE;
-       //if(other == o) // allow sending entcs for self, for damage effects to work. To be decided!
-       //      return FALSE;
-       if(other.classname == "player")
+       if(other == o)
+               return FALSE;
+       if((IS_PLAYER(other)) || other.caplayer)
                if(!teamplay || o.team != other.team)
-                       //if not (radar_showennemies)
-                       if not (checkpvs(other.origin + other.view_ofs, o))  // allow sending entcs for enemies in view, for damage effects to work. To be decided!
+                       if (!radar_showennemies)
                                return FALSE;
        return TRUE;
 }
@@ -57,7 +56,7 @@ float entcs_send(entity to, float sf)
        if(sf & 16)
                WriteByte(MSG_ENTITY, self.armorvalue / 10); // FIXME use a better scale?
        return TRUE;
-};
+}
 
 void entcs_think()
 {
@@ -86,11 +85,11 @@ void entcs_think()
                self.armorvalue = o.armorvalue;
                self.SendFlags |= 16;
        }
-};
+}
 
 entity attach_entcs()
 {
-       local entity ent;
+       entity ent;
 
        ent = spawn();
        ent.classname = "entcs_sender_v2";
@@ -104,10 +103,10 @@ entity attach_entcs()
        self.entcs = ent;
 
        return ent;
-};
+}
 
 void detach_entcs()
 {
        remove(self.entcs);
        self.entcs = world;
-};
+}