]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/lib/csqcmodel/sv_model.qc
Merge branch 'master' into Mario/weaponorder
[xonotic/xonotic-data.pk3dir.git] / qcsrc / lib / csqcmodel / sv_model.qc
index dd8d5d33aaee2a8f479cd6edcc34f9047adf6730..70e2c1a15e9bf10f6a4a09bf9378a10f724ba5c8 100644 (file)
 #include "sv_model.qh"
 
 #include "common.qh"
-#include <common/animdecide.qh>
-#include <common/constants.qh>
-#include <common/net_linked.qh>
-#include <common/util.qh>
-#include <server/constants.qh>
-#include <server/defs.qh>
 
 // generic CSQC model code
 
@@ -38,9 +32,14 @@ bool CSQCModel_Send(entity this, entity to, int sf)
        noref bool islocalplayer = (this == to);
        noref bool isnolocalplayer = (isplayer && (this != to));
 
+       int psf = 0;
+       psf = BITSET(psf, ISPLAYER_CLIENT, isplayer);
+       psf = BITSET(psf, ISPLAYER_LOCAL, islocalplayer);
+       psf = BITSET(psf, ISPLAYER_PLAYER, IS_PLAYER(this));
+
        WriteHeader(MSG_ENTITY, ENT_CLIENT_MODEL);
        WriteInt24_t(MSG_ENTITY, sf);
-       WriteByte(MSG_ENTITY, isplayer);
+       WriteByte(MSG_ENTITY, psf);
 
 #define CSQCMODEL_IF(cond) if(cond) {
 #define CSQCMODEL_ENDIF }
@@ -49,7 +48,11 @@ bool CSQCModel_Send(entity this, entity to, int sf)
        { \
                w(MSG_ENTITY, this.csqcmodel_##f); \
        }
-#define CSQCMODEL_PROPERTY_SCALED(flag,t,r,w,f,s,mi,ma) CSQCMODEL_PROPERTY(flag,t,r,w,f)
+#define CSQCMODEL_PROPERTY_SCALED(flag,t,r,w,f,s,mi,ma) \
+       if(sf & flag) \
+       { \
+               w(MSG_ENTITY, this.csqcmodel_##f); \
+       }
        ALLPROPERTIES
 #undef CSQCMODEL_PROPERTY_SCALED
 #undef CSQCMODEL_PROPERTY