2 * The point of these entities is to avoid the problems
3 * with clientprediction.
4 * If you add SendEntity to players, the engine will not
5 * do any prediction anymore, and you'd have to write the whole
6 * prediction code in CSQC, you want that? :P
7 * Data can depend on gamemode. For now, it serves as GPS entities
8 * in onslaught... YAY ;)
11 // Beware: do not redefine those in other files
12 // and NO, you cannot use ".version", which already exists (at least
13 // it did when I added this) But you have to use .Version
20 print("Initializing ClientSide information entities\n");
23 float entcs_customize()
27 if(o.deadflag != DEAD_NO)
29 if(o.classname != "player")
33 if(other.classname == "player")
34 if(o.team != other.team)
35 if not (radar_showennemies)
40 float entcs_send(entity to, float sf)
44 WriteByte(MSG_ENTITY, ENT_CLIENT_ENTCS);
45 WriteByte(MSG_ENTITY, num_for_edict(o));
46 WriteShort(MSG_ENTITY, o.origin_x);
47 WriteShort(MSG_ENTITY, o.origin_y);
48 WriteShort(MSG_ENTITY, o.origin_z);
49 WriteByte(MSG_ENTITY, o.angles_y * 256.0 / 360);
55 self.nextthink = time;
60 if(o.origin != self.origin || o.angles != self.angles)
62 setorigin(self, o.origin);
63 self.angles = o.angles;
73 ent.classname = "entcs_sender_v2";
75 ent.think = entcs_think;
78 Net_LinkEntity(ent, FALSE, 0, entcs_send);
79 ent.customizeentityforclient = entcs_customize;