]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Move the supercontents/nativecontents functions to util.qc
authorSamual Lenks <samual@xonotic.org>
Sat, 25 Jan 2014 22:21:36 +0000 (17:21 -0500)
committerSamual Lenks <samual@xonotic.org>
Sat, 25 Jan 2014 22:21:36 +0000 (17:21 -0500)
qcsrc/client/movetypes.qc
qcsrc/common/util.qc
qcsrc/common/util.qh

index 88e921cbeace695f5875776708a4da35e0e3cf8d..a4122d261f175961a4b52ae55a1c21418b3141f6 100644 (file)
@@ -10,41 +10,6 @@ void _Movetype_CheckVelocity() // SV_CheckVelocity
 {
 }
 
-float Mod_Q1BSP_SuperContentsFromNativeContents(float nativecontents)
-{
-       switch(nativecontents)
-       {
-               case CONTENT_EMPTY:
-                       return 0;
-               case CONTENT_SOLID:
-                       return DPCONTENTS_SOLID | DPCONTENTS_OPAQUE;
-               case CONTENT_WATER:
-                       return DPCONTENTS_WATER;
-               case CONTENT_SLIME:
-                       return DPCONTENTS_SLIME;
-               case CONTENT_LAVA:
-                       return DPCONTENTS_LAVA | DPCONTENTS_NODROP;
-               case CONTENT_SKY:
-                       return DPCONTENTS_SKY | DPCONTENTS_NODROP | DPCONTENTS_OPAQUE; // to match behaviour of Q3 maps, let sky count as opaque
-       }
-       return 0;
-}
-
-float Mod_Q1BSP_NativeContentsFromSuperContents(float supercontents)
-{
-       if(supercontents & (DPCONTENTS_SOLID | DPCONTENTS_BODY))
-               return CONTENT_SOLID;
-       if(supercontents & DPCONTENTS_SKY)
-               return CONTENT_SKY;
-       if(supercontents & DPCONTENTS_LAVA)
-               return CONTENT_LAVA;
-       if(supercontents & DPCONTENTS_SLIME)
-               return CONTENT_SLIME;
-       if(supercontents & DPCONTENTS_WATER)
-               return CONTENT_WATER;
-       return CONTENT_EMPTY;
-}
-
 float _Movetype_CheckWater(entity ent) // SV_CheckWater
 {
        float supercontents;
index 1904e91c1afa1d440c4bcdcfb7bdd4d39e0c811c..bdf80e5d1cb92f698d3944743f7d4a5375258570 100644 (file)
@@ -2752,3 +2752,40 @@ float Announcer_PickNumber(float type, float num)
        return NOTIF_ABORT; // abort sending if none of these numbers were right
 }
 #endif
+
+#ifndef MENUQC
+float Mod_Q1BSP_SuperContentsFromNativeContents(float nativecontents)
+{
+       switch(nativecontents)
+       {
+               case CONTENT_EMPTY:
+                       return 0;
+               case CONTENT_SOLID:
+                       return DPCONTENTS_SOLID | DPCONTENTS_OPAQUE;
+               case CONTENT_WATER:
+                       return DPCONTENTS_WATER;
+               case CONTENT_SLIME:
+                       return DPCONTENTS_SLIME;
+               case CONTENT_LAVA:
+                       return DPCONTENTS_LAVA | DPCONTENTS_NODROP;
+               case CONTENT_SKY:
+                       return DPCONTENTS_SKY | DPCONTENTS_NODROP | DPCONTENTS_OPAQUE; // to match behaviour of Q3 maps, let sky count as opaque
+       }
+       return 0;
+}
+
+float Mod_Q1BSP_NativeContentsFromSuperContents(float supercontents)
+{
+       if(supercontents & (DPCONTENTS_SOLID | DPCONTENTS_BODY))
+               return CONTENT_SOLID;
+       if(supercontents & DPCONTENTS_SKY)
+               return CONTENT_SKY;
+       if(supercontents & DPCONTENTS_LAVA)
+               return CONTENT_LAVA;
+       if(supercontents & DPCONTENTS_SLIME)
+               return CONTENT_SLIME;
+       if(supercontents & DPCONTENTS_WATER)
+               return CONTENT_WATER;
+       return CONTENT_EMPTY;
+}
+#endif
index 978aec94bd3fdbf635389ccc3bfa67a2b3f46637..820f4f5db3fe626400502f4dd78656c402a4aa42 100644 (file)
@@ -436,3 +436,8 @@ void dedicated_print(string input);
 #define CNT_ROUNDSTART 6
 float Announcer_PickNumber(float type, float num);
 #endif
+
+#ifndef MENUQC
+float Mod_Q1BSP_SuperContentsFromNativeContents(float nativecontents);
+float Mod_Q1BSP_NativeContentsFromSuperContents(float supercontents);
+#endif