- WriteCoord(MSG_ENTITY, self.tur_head.angles_x);
- WriteCoord(MSG_ENTITY, self.tur_head.angles_y);
- WriteByte(MSG_ENTITY, self.tur_head.frame);
-
- //WriteCoord(MSG_ENTITY, self.tur_head.angles_z);
-
+
+ WriteByte(MSG_ENTITY, sf);
+ if(sf & TNSF_SETUP)
+ {
+ WriteByte(MSG_ENTITY, self.turret_type);
+
+ WriteCoord(MSG_ENTITY, self.origin_x);
+ WriteCoord(MSG_ENTITY, self.origin_y);
+ WriteCoord(MSG_ENTITY, self.origin_z);
+
+ WriteAngle(MSG_ENTITY, self.angles_x);
+ WriteAngle(MSG_ENTITY, self.angles_y);
+ }
+
+ if(sf & TNSF_ANG)
+ {
+ if(sf & TNSF_FAR)
+ {
+ WriteShort(MSG_ENTITY, rint(self.tur_head.angles_x));
+ WriteShort(MSG_ENTITY, rint(self.tur_head.angles_y));
+ }
+ else
+ {
+ WriteAngle(MSG_ENTITY, self.tur_head.angles_x);
+ WriteAngle(MSG_ENTITY, self.tur_head.angles_y);
+ }
+ }
+
+ if(sf & TNSF_AVEL)
+ {
+ if(sf & TNSF_FAR)
+ {
+ WriteShort(MSG_ENTITY, rint(self.tur_head.avelocity_x));
+ WriteShort(MSG_ENTITY, rint(self.tur_head.avelocity_y));
+ }
+ else
+ {
+ WriteAngle(MSG_ENTITY, self.tur_head.avelocity_x);
+ WriteAngle(MSG_ENTITY, self.tur_head.avelocity_y);
+ }
+ }
+
+ if(sf & TNSF_STATUS)
+ {
+ WriteByte(MSG_ENTITY, self.team);
+ WriteByte(MSG_ENTITY, rint((self.health / self.tur_health) * 255)); // Send health as 0-255 insted of real value, where 255 = 100%
+ }
+