Merge branch 'master' into Mario/vehicles
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / csqcmodel_settings.qh
index 6b5f3bd..ac14969 100644 (file)
 # define TAG_ENTITY_NAME tag_networkentity
 # define TAG_ENTITY_TYPE float
 .float tag_networkentity;
+
+# define TAG_VIEWLOC_NAME tag_networkviewloc
+# define TAG_VIEWLOC_TYPE int
+.float tag_networkviewloc;
 #else
 # define TAG_ENTITY_NAME tag_entity
 # define TAG_ENTITY_TYPE entity
+
+# define TAG_VIEWLOC_NAME viewloc
+# define TAG_VIEWLOC_TYPE entity
 #endif
 
 // new fields
@@ -53,7 +60,8 @@
        CSQCMODEL_ENDIF \
        CSQCMODEL_PROPERTY(1024, float, ReadAngle, WriteAngle, v_angle_x) \
        CSQCMODEL_PROPERTY_SCALED(4096, float, ReadByte, WriteByte, scale, 16, 0, 255) \
-       CSQCMODEL_PROPERTY(8192, int, ReadInt24_t, WriteInt24_t, dphitcontentsmask)
+       CSQCMODEL_PROPERTY(8192, int, ReadInt24_t, WriteInt24_t, dphitcontentsmask) \
+       CSQCMODEL_PROPERTY(16384, TAG_VIEWLOC_TYPE, ReadShort, WriteEntity, TAG_VIEWLOC_NAME) 
 // TODO get rid of colormod/glowmod here, find good solution for vortex charge glowmod hack; also get rid of some useless properties on non-players that only exist for CopyBody
 
 // add hook function calls here
@@ -63,7 +71,8 @@
        CSQCModel_Hook_PostUpdate(isnew, isplayer, islocalplayer);
 #define CSQCMODEL_HOOK_PREDRAW \
        CSQCModel_Hook_PreDraw(isplayer);
-#define CSQCPLAYER_HOOK_POSTCAMERASETUP
+#define CSQCPLAYER_HOOK_POSTCAMERASETUP \
+       CSQCPlayer_SetViewLocation();
 
 // force updates of player entities that often even if unchanged
 #define CSQCPLAYER_FORCE_UPDATES 0.25