X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;ds=sidebyside;f=qcsrc%2Fserver%2Fent_cs.qc;h=7b3af04bfd9aa9f988f72f7e9a53b28d4ad2a96c;hb=b38e2bae0a50554f26bf5af1fbd0e70b97cc0c71;hp=0763785bc0cd996a6ffb1b7551ec442e18fb4413;hpb=7ed7d6f41a0161175e05a7d4c7bb2c640542d90d;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/ent_cs.qc b/qcsrc/server/ent_cs.qc index 0763785bc..7b3af04bf 100644 --- a/qcsrc/server/ent_cs.qc +++ b/qcsrc/server/ent_cs.qc @@ -18,7 +18,7 @@ void entcs_init() { print("Initializing ClientSide information entities\n"); -}; +} float entcs_customize() { @@ -26,25 +26,19 @@ float entcs_customize() o = self.owner; if(o.deadflag != DEAD_NO) return FALSE; - if(o.classname != "player") + if (!IS_PLAYER(o)) return FALSE; if(other == o) return FALSE; - if(other.classname == "player") - if(!teams_matter || o.team != other.team) - if not (radar_showennemies) + if((IS_PLAYER(other)) || other.caplayer) + if(!teamplay || o.team != other.team) + if (!radar_showennemies) return FALSE; return TRUE; } float entcs_send(entity to, float sf) { - // a simple safeguard, should not REALLY be needed - sf |= 128; - if(teams_matter && !radar_showennemies) - if(to.team != self.team) - sf &~= (8 | 16 | 128); // don't send h/a for enemies - WriteByte(MSG_ENTITY, ENT_CLIENT_ENTCS); WriteByte(MSG_ENTITY, sf); if(sf & 1) @@ -62,11 +56,11 @@ 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() { - self.nextthink = time; + self.nextthink = time + 0.033333333333; // increase this to like 0.15 once the client can do smoothing entity o; o = self.owner; @@ -91,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"; @@ -109,10 +103,10 @@ entity attach_entcs() self.entcs = ent; return ent; -}; +} void detach_entcs() { remove(self.entcs); self.entcs = world; -}; +}