]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
when NOT networking players by this code, also network tag_entity; ignore tag_index
authorRudolf Polzer <divverent@alientrap.org>
Fri, 2 Dec 2011 08:22:41 +0000 (09:22 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Fri, 2 Dec 2011 08:22:41 +0000 (09:22 +0100)
tag_index could later be found automatically by checking which models we
have... e.g. use "bip01 r hand" if a weapon model is attached to a player model

qcsrc/common/util.qc
qcsrc/common/util.qh
qcsrc/csqcmodel/settings.qh

index 10e4e345b28298ead91a5420e4c0c11da92dc36b..10f77b6cdfedeb59629f375f4ca5cd9f9a4da2bd 100644 (file)
@@ -2107,3 +2107,14 @@ float lowestbit(float f)
        f &~= f * 65536;
        return f;
 }
+
+#ifdef CSQC
+entity ReadCSQCEntity()
+{
+       float f;
+       f = ReadShort();
+       if(f == 0)
+               return world;
+       return findfloat(world, entnum, f);
+}
+#endif
index b2e77484e398695ea3b2febb290bd217cdf83af5..e2dfcb3b86b1257c7b440837e7714fc78a1e48ff 100644 (file)
@@ -270,3 +270,7 @@ float xdecode(string s);
 #ifndef COMPAT_XON010_CHANNELS
 #define sound(e,c,s,v,a) sound7(e,c,s,v,a,0,0)
 #endif
+
+#ifdef CSQC
+entity ReadCSQCEntity()
+#endif
index 97b5d661363f5695d6c7c9862c01f9e8e067c75a..89e1b1de7ec2211d3ae1f031f10003320e5be2c2 100644 (file)
                CSQCMODEL_PROPERTY(2, ReadShort, WriteShort, colormap) \
                CSQCMODEL_PROPERTY(4, ReadInt24_t, WriteInt24_t, effects) \
                CSQCMODEL_PROPERTY_SCALED(8, ReadByte, WriteByte, alpha, 255, 0, 255) \
+       CSQCMODEL_ENDIF \
+       CSQCMODEL_IF(!isplayer) \
+               CSQCMODEL_PROPERTY(1, ReadCSQCEntity, WriteEntity, tag_entity) \
        CSQCMODEL_ENDIF
 
+// declare "odd" fields here
+.entity tag_entity;
+
 // add hook function calls here
 #define CSQCMODEL_HOOK_PREUPDATE
 #define CSQCMODEL_HOOK_POSTUPDATE