# define TAG_VIEWLOC_TYPE int
.float tag_networkviewloc;
-# define MOVETYPE_NAME move_movetype
+# define ALPHA m_alpha
+.float m_alpha;
+
+# define GROUNDENTITY_NAME ground_networkentity
+# define GROUNDENTITY_TYPE float
+.float ground_networkentity;
#else
# define TAG_ENTITY_NAME tag_entity
# define TAG_ENTITY_TYPE entity
# define TAG_VIEWLOC_NAME viewloc
# define TAG_VIEWLOC_TYPE entity
-# define MOVETYPE_NAME move_movetype
-#endif
+# define ALPHA alpha
-// new fields
-.vector v_angle;
+# define GROUNDENTITY_NAME groundentity
+# define GROUNDENTITY_TYPE entity
+#endif
// add properties you want networked to CSQC here
#define CSQCMODEL_EXTRAPROPERTIES \
CSQCMODEL_PROPERTY(BIT(0), int, ReadShort, WriteShort, colormap) \
CSQCMODEL_PROPERTY(BIT(1), int, ReadInt24_t, WriteInt24_t, effects) \
CSQCMODEL_PROPERTY(BIT(2), int, ReadByte, WriteByte, modelflags) \
- CSQCMODEL_PROPERTY_SCALED(BIT(3), float, ReadByte, WriteByte, alpha, 254, -1, 254) \
+ CSQCMODEL_PROPERTY_SCALED(BIT(3), float, ReadByte, WriteByte, ALPHA, 254, -1, 254) /* NOTE: update the use of this in cl_model.qc if you change the bitflag number! */ \
CSQCMODEL_PROPERTY(BIT(4), int, ReadByte, WriteByte, skin) \
CSQCMODEL_PROPERTY(BIT(5), float, ReadApproxPastTime, WriteApproxPastTime, death_time) \
CSQCMODEL_PROPERTY(BIT(6), float, ReadByte, WriteByte, solid) \
CSQCMODEL_PROPERTY_SCALED(BIT(8), float, ReadByte, WriteByte, glowmod_x, 254, -1, 254) \
CSQCMODEL_PROPERTY_SCALED(BIT(8), float, ReadByte, WriteByte, glowmod_y, 254, -1, 254) \
CSQCMODEL_PROPERTY_SCALED(BIT(8), float, ReadByte, WriteByte, glowmod_z, 254, -1, 254) \
- CSQCMODEL_PROPERTY_SCALED(BIT(8), float, ReadByte, WriteByte, colormod_x, 254, -1, 254) \
- CSQCMODEL_PROPERTY_SCALED(BIT(8), float, ReadByte, WriteByte, colormod_y, 254, -1, 254) \
- CSQCMODEL_PROPERTY_SCALED(BIT(8), float, ReadByte, WriteByte, colormod_z, 254, -1, 254) \
CSQCMODEL_ENDIF \
+ CSQCMODEL_PROPERTY_SCALED(BIT(8), float, ReadByte, WriteByte, colormod_x, 16, 0, 255) \
+ CSQCMODEL_PROPERTY_SCALED(BIT(8), float, ReadByte, WriteByte, colormod_y, 16, 0, 255) \
+ CSQCMODEL_PROPERTY_SCALED(BIT(8), float, ReadByte, WriteByte, colormod_z, 16, 0, 255) \
CSQCMODEL_IF(isplayer) \
CSQCMODEL_PROPERTY(BIT(7), int, ReadByte, WriteByte, anim_state) \
CSQCMODEL_PROPERTY(BIT(7), float, ReadApproxPastTime, WriteApproxPastTime, anim_time) \
CSQCMODEL_ENDIF \
CSQCMODEL_PROPERTY(BIT(10), float, ReadAngle, WriteAngle, v_angle_x) \
CSQCMODEL_PROPERTY(BIT(11), int, ReadByte, WriteByte, traileffect) \
- CSQCMODEL_PROPERTY_SCALED(BIT(12), float, ReadByte, WriteByte, scale, 16, 0, 255) \
+ CSQCMODEL_PROPERTY(BIT(12), float, ReadCoord, WriteCoord, scale) \
CSQCMODEL_PROPERTY(BIT(13), int, ReadInt24_t, WriteInt24_t, dphitcontentsmask) \
- CSQCMODEL_PROPERTY(BIT(14), TAG_VIEWLOC_TYPE, ReadShort, WriteEntity, TAG_VIEWLOC_NAME) \
- CSQCMODEL_PROPERTY(BIT(15), int, ReadByte, WriteByte, multijump_count) \
- CSQCMODEL_PROPERTY(BIT(16), int, ReadByte, WriteByte, MOVETYPE_NAME)
+ CSQCMODEL_PROPERTY(BIT(14), TAG_VIEWLOC_TYPE, ReadShort, WriteEntity, TAG_VIEWLOC_NAME) /* NOTE: update the use of this in cl_model.qc if you change the bitflag number! */ \
+ /* bit 15 should NOT be reused, it is large enough sending the model's hitbox vectors! */ \
+ CSQCMODEL_PROPERTY(BIT(16), int, ReadByte, WriteByte, multijump_count) \
+ CSQCMODEL_PROPERTY(BIT(16), int, ReadByte, WriteByte, move_movetype) \
+ CSQCMODEL_IF(isplayer) \
+ CSQCMODEL_PROPERTY(BIT(17), GROUNDENTITY_TYPE, ReadShort, WriteEntity, GROUNDENTITY_NAME) \
+ CSQCMODEL_ENDIF \
+ CSQCMODEL_PROPERTY(BIT(17), int, ReadByte, WriteByte, clipgroup)
+// NOTE: bits above 15 are defined in lib/csqcmodel/common.qh, avoid reusing them if possible
// TODO get rid of colormod/glowmod here; also get rid of some useless properties on non-players that only exist for CopyBody
// add hook function calls here
#define CSQCPLAYER_HOOK_POSTCAMERASETUP() \
- CSQCPlayer_SetViewLocation()
+ viewloc_SetViewLocation()
// force updates of player entities this frequently (per second) even if unchanged
#ifndef CSQCPLAYER_FORCE_UPDATES