case ENT_CLIENT_ACCURACY: Ent_ReadAccuracy(); break;
case ENT_CLIENT_AUXILIARYXHAIR: Net_AuXair2(bIsNewEntity); break;
case ENT_CLIENT_TURRET: ent_turret(); break;
+ case ENT_CLIENT_MODEL: CSQCModel_Read(); break;
default:
//error(strcat(_("unknown entity type in CSQC_Ent_Update: %d\n"), self.enttype));
error(sprintf(_("Unknown entity type in CSQC_Ent_Update (enttype: %d, edict: %d, classname: %s)\n"), self.enttype, num_for_edict(self), self.classname));
WaypointSprite_Load();
+ if((e = findfloat(world, entnum, player_localentnum)))
+ {
+ R_SetView3fv(VF_ORIGIN, e.origin + e.view_ofs);
+ R_SetView3fv(VF_ANGLES, e.angles);
+ }
+
if(spectatee_status)
myteam = GetPlayerColor(spectatee_status - 1);
else
../server/movelib.qc
main.qh
vehicles/vehicles.qh
+../common/csqcmodel.qh
sortlist.qc
miscfunctions.qc
gibs.qc
damage.qc
casings.qc
+../common/csqcmodel.qc
effects.qc
wall.qc
modeleffects.qc
--- /dev/null
+// generic CSQC model code
+
+.vector glowmod;
+.vector view_ofs;
+
+#define ALLPROPERTIES \
+ PROPERTY(1, ReadCoord, WriteCoord, origin_x) \
+ PROPERTY(1, ReadCoord, WriteCoord, origin_y) \
+ PROPERTY(1, ReadCoord, WriteCoord, origin_z) \
+ PROPERTY(2, ReadAngle, WriteAngle, angles_x) \
+ PROPERTY(2, ReadAngle, WriteAngle, angles_y) \
+ PROPERTY(2, ReadAngle, WriteAngle, angles_z) \
+ PROPERTY(4, ReadShort, WriteShort, modelindex) \
+ PROPERTY(8, ReadByte, WriteByte, frame) \
+ PROPERTY(16, ReadByte, WriteByte, skin) \
+ PROPERTY(32, ReadInt24_t, WriteInt24_t, effects) \
+ PROPERTY_SCALED(64, ReadByte, WriteByte, alpha, 255, 0, 255) \
+ PROPERTY_SCALED(128, ReadByte, WriteByte, glowmod_x, 32, 0, 255) \
+ PROPERTY_SCALED(128, ReadByte, WriteByte, glowmod_y, 32, 0, 255) \
+ PROPERTY_SCALED(128, ReadByte, WriteByte, glowmod_z, 32, 0, 255) \
+ PROPERTY(256, ReadChar, WriteChar, view_ofs_z)
+
+#ifdef SVQC
+
+#define PROPERTY(flag,r,w,f) \
+ .float csqcmodel_##f;
+#define PROPERTY_SCALED(flag,r,w,f,s,mi,ma) PROPERTY(flag,r,w,f)
+ ALLPROPERTIES
+#undef PROPERTY_SCALED
+#undef PROPERTY
+
+float CSQCModel_Send(entity to, float sf)
+{
+ WriteByte(MSG_ENTITY, ENT_CLIENT_MODEL);
+ WriteShort(MSG_ENTITY, sf);
+
+#define PROPERTY(flag,r,w,f) \
+ if(sf & flag) \
+ { \
+ w(MSG_ENTITY, self.csqcmodel_##f); \
+ }
+#define PROPERTY_SCALED(flag,r,w,f,s,mi,ma) PROPERTY(flag,r,w,f)
+ ALLPROPERTIES
+#undef PROPERTY_SCALED
+#undef PROPERTY
+
+ return TRUE;
+}
+
+void CSQCModel_CheckUpdate()
+{
+ float tmp;
+#define PROPERTY(flag,r,w,f) \
+ tmp = self.f; \
+ if(tmp != self.csqcmodel_##f) \
+ { \
+ self.csqcmodel_##f = tmp; \
+ self.SendFlags |= flag; \
+ }
+#define PROPERTY_SCALED(flag,r,w,f,s,mi,ma) \
+ tmp = bound(mi, s * self.f, ma); \
+ if(tmp != self.csqcmodel_##f) \
+ { \
+ self.csqcmodel_##f = tmp; \
+ self.SendFlags |= flag; \
+ }
+ ALLPROPERTIES
+#undef PROPERTY_SCALED
+#undef PROPERTY
+}
+
+void CSQCModel_LinkEntity()
+{
+ Net_LinkEntity(self, TRUE, 0, CSQCModel_Send);
+}
+
+#endif
+
+#ifdef CSQC
+
+void CSQCModel_Read()
+{
+ float sf;
+ sf = ReadShort();
+
+ print("Read an update of flags: ", ftos(sf), "\n");
+
+#define PROPERTY(flag,r,w,f) \
+ if(sf & flag) \
+ self.f = r();
+#define PROPERTY_SCALED(flag,r,w,f,s,mi,ma) \
+ if(sf & flag) \
+ self.f = r() / s;
+ ALLPROPERTIES
+#undef PROPERTY_SCALED
+#undef PROPERTY
+
+ // if it is the local player, prediction
+ // interpolation
+
+ // CSQC_UpdateView has to set camera to this if this is the local player
+
+ // draw it
+}
+
+#endif
--- /dev/null
+// generic CSQC model code
+
+#ifdef SVQC
+void CSQCModel_CheckUpdate();
+void CSQCModel_LinkEntity();
+#endif
+
+#ifdef CSQC
+void CSQCModel_Read();
+#endif
if(!autocvar_g_campaign)
Send_CSQC_Centerprint_Generic(self, CPID_MOTD, getwelcomemessage(), autocvar_welcome_message_time, 0);
+
+ CSQCModel_LinkEntity();
}
/*
if(g_race)
dprint(sprintf("%f %.6f\n", time, race_GetFractionalLapCount(self)));
*/
+
+ CSQCModel_CheckUpdate();
}
+++ /dev/null
-// generic CSQC model code
-
-#define ALLPROPERTIES \
- PROPERTY(1, ReadCoord, WriteCoord, origin_x) \
- PROPERTY(1, ReadCoord, WriteCoord, origin_y) \
- PROPERTY(1, ReadCoord, WriteCoord, origin_z) \
- PROPERTY(2, ReadAngle, WriteAngle, angles_x) \
- PROPERTY(2, ReadAngle, WriteAngle, angles_y) \
- PROPERTY(2, ReadAngle, WriteAngle, angles_z) \
- PROPERTY(4, ReadShort, WriteShort, modelindex) \
- PROPERTY(8, ReadByte, WriteByte, frame) \
- PROPERTY(16, ReadByte, WriteByte, skin) \
- PROPERTY(32, ReadInt24_t, WriteInt24_t, effects) \
- PROPERTY_SCALED(64, ReadByte, WriteByte, alpha, 255, 0, 255) \
- PROPERTY_SCALED(128, ReadByte, WriteByte, glowmod_x, 32, 0, 255) \
- PROPERTY_SCALED(128, ReadByte, WriteByte, glowmod_y, 32, 0, 255) \
- PROPERTY_SCALED(128, ReadByte, WriteByte, glowmod_z, 32, 0, 255)
-
-#ifdef SVQC
-
-#define PROPERTY(flag,r,w,f) \
- .float csqcmodel_##f;
-#define PROPERTY_SCALED(flag,r,w,f,s,mi,ma) PROPERTY(flag,r,w,f)
- ALLPROPERTIES
-#undef PROPERTY_SCALED
-#undef PROPERTY
-
-float CSQCModel_Send(entity to, float sf)
-{
- WriteByte(MSG_ENTITY, ENT_CLIENT_MODEL);
- WriteShort(MSG_ENTITY, sf);
-
-#define PROPERTY(flag,r,w,f) \
- if(sf & flag) \
- { \
- w(MSG_ENTITY, self.csqcmodel_##f); \
- }
-#define PROPERTY_SCALED(flag,r,w,f,s,mi,ma) PROPERTY(flag,r,w,f)
- ALLPROPERTIES
-#undef PROPERTY_SCALED
-#undef PROPERTY
-
- return TRUE;
-}
-
-void CSQCModel_CheckUpdate()
-{
- float tmp;
-#define PROPERTY(flag,r,w,f) \
- tmp = self.f; \
- if(tmp != self.csqcmodel_##f) \
- { \
- self.csqcmodel_##f = tmp; \
- self.SendFlags |= flag; \
- }
-#define PROPERTY_SCALED(flag,r,w,f,s,mi,ma) \
- tmp = bound(mi, s * self.f, ma); \
- if(tmp != self.csqcmodel_##f) \
- { \
- self.csqcmodel_##f = tmp; \
- self.SendFlags |= flag; \
- }
- ALLPROPERTIES
-#undef PROPERTY_SCALED
-#undef PROPERTY
-}
-
-void CSQCModel_LinkEntity()
-{
- Net_LinkEntity(self, TRUE, 0, CSQCModel_Send);
-}
-
-#endif
-
-#ifdef CSQC
-
-void CSQCModel_Read()
-{
- float sf;
- sf = ReadShort();
-
-#define PROPERTY(flag,r,w,f) \
- if(sf & flag) \
- self.f = r();
-#define PROPERTY_SCALED(flag,r,w,f,s,mi,ma) \
- if(sf & flag) \
- self.f = r() / s;
- ALLPROPERTIES
-#undef PROPERTY_SCALED
-#undef PROPERTY
-
- // if it is the local player, prediction and make sure camera gets set up by it
- // interpolation
- // draw it
-}
-
-#endif
+++ /dev/null
-// generic CSQC model code
-
-#ifdef SVQC
-void CSQCModel_CheckUpdate();
-void CSQCModel_LinkEntity();
-#endif
-
-#ifdef CSQC
-void CSQCModel_Read();
-#endif
accuracy.qh
csqcprojectile.qh
-csqcmodel.qh
+../common/csqcmodel.qh
csqceffects.qc
anticheat.qh
accuracy.qc
-csqcmodel.qc
+../common/csqcmodel.qc
csqcprojectile.qc
playerdemo.qc