]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/lib/csqcmodel/sv_model.qc
Merge branch 'terencehill/v_deathtilt_fix' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / lib / csqcmodel / sv_model.qc
index 60ad7252f9b853b11d742b1cf4ac14bbb0bd7e3d..b02df19e0015a25a0f96df60d8abe5a3f5984976 100644 (file)
 
 // generic CSQC model code
 
-bool CSQCModel_Send(entity to, int sf)
+bool CSQCModel_Send(entity this, entity to, int sf)
 {
-    SELFPARAM();
        // some nice flags for CSQCMODEL_IF
-       float isplayer = (IS_CLIENT(self));
-       float islocalplayer = (self == to);
-       float isnolocalplayer = (isplayer && (self != to));
-
-       unused_float = isplayer;
-       unused_float = islocalplayer;
-       unused_float = isnolocalplayer;
+       noref bool isplayer = IS_CLIENT(this);
+       noref bool islocalplayer = (this == to);
+       noref bool isnolocalplayer = (isplayer && (this != to));
 
        WriteHeader(MSG_ENTITY, ENT_CLIENT_MODEL);
        WriteInt24_t(MSG_ENTITY, sf);
+       WriteByte(MSG_ENTITY, isplayer);
 
 #define CSQCMODEL_IF(cond) if(cond) {
 #define CSQCMODEL_ENDIF }
 #define CSQCMODEL_PROPERTY(flag,t,r,w,f) \
        if(sf & flag) \
        { \
-               w(MSG_ENTITY, self.csqcmodel_##f); \
+               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)
        ALLPROPERTIES
@@ -68,7 +64,7 @@ bool CSQCModel_Send(entity to, int sf)
 void CSQCModel_CheckUpdate(entity e)
 {
        // some nice flags for CSQCMODEL_IF
-       float isplayer = (IS_CLIENT(e));
+       float isplayer = IS_CLIENT(e);
        float islocalplayer = isplayer; // we set BOTH to 1 here as we need the sendflags
        float isnolocalplayer = isplayer; // we set BOTH to 1 here as we need the sendflags
 
@@ -125,7 +121,8 @@ void CSQCModel_CheckUpdate(entity e)
 
 void CSQCModel_LinkEntity(entity e)
 {
-       e.SendEntity = CSQCModel_Send;
+       e.SendEntity = SendEntity_self;
+       e.SendEntity3 = CSQCModel_Send;
        e.SendFlags = 0xFFFFFF;
        CSQCModel_CheckUpdate(e);
 }
@@ -133,4 +130,5 @@ void CSQCModel_LinkEntity(entity e)
 void CSQCModel_UnlinkEntity(entity e)
 {
        e.SendEntity = func_null;
+       e.SendEntity3 = func_null;
 }